Skip to content

feat(modeling): add center option to torus - #1492

Merged
z3dev merged 1 commit into
jscad:masterfrom
MaccheroniCode:feat/torus-center
Nov 1, 2026
Merged

z3dev merged 1 commit into
jscad:masterfrom
MaccheroniCode:feat/torus-center

Conversation

@B3rn475

@B3rn475 B3rn475 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Add center option to torus.

This aligns the torus options to the rest of the primitives where a center can be specified.

#1476

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Does your submission pass tests?

Note: please do NOT include build files (those generate by the build-xxx commands) with your PR,

Thank you for your help in advance, much appreciated !

@z3dev z3dev left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes. Just one suggestion. Please review.

And a quick test case would be nice. See torus.test.js for the test suite.

}
return extrudeRotate(extrudeOptions, innerCircle)
let result = extrudeRotate(extrudeOptions, innerCircle);
if (center[0] !== 0 && center[1] !== 0 && center[2] !== 0) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this? As the center could be [0, 0, 5]

if ((center[0] !== 0) || (center[1] !== 0) || (center[2] !== 0)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Thank You for noticing.
Sorry for the bad copy-paste from another attempt.

Add center option to torus.

This aligns the torus options to the rest of the primitives where a center can be specified.

Co-authored-by: Simone Cattaneo <katta@maccheronicode.it>
on-behalf-of: @MaccheroniCode <info@maccheronicode.it>

@z3dev z3dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@B3rn475 Looks good. Thanks much.

@z3dev
z3dev merged commit 0e2c05b into jscad:master Nov 1, 2026
2 checks passed
@B3rn475
B3rn475 deleted the feat/torus-center branch November 1, 2026 19:42
@B3rn475

B3rn475 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

QQ: Will this change be ported to V3 automatically or should we propose that change too?

While I used JSCAD for years, I'm new to its development workflow and I would like to be sure to follow the best practices.

@z3dev

z3dev commented Nov 3, 2026

Copy link
Copy Markdown
Member

I sync V2 and V3 periodically so the changes will come into V3. If you want the changes faster then best open a new pull request. I will release V3 soon.

@B3rn475

B3rn475 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Not in a hurry. I was just wondering what was the "standard procedure".

If V3 is coming soon, I better start migrating my models.
Context: we use JSCAD often and publish our models, so I want to be sure that they are aligned with best practices.
https://youtube.com/playlist?list=PLYjRSKzUAW50

@hrgdavor

hrgdavor commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

subscribed :) ... join us on discord if not already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants