Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TorusPipe.createAlongArc returns pipe with wrong angular sweep #6691

Closed
dovydasjaru opened this issue May 2, 2024 · 1 comment · Fixed by #6761
Closed

TorusPipe.createAlongArc returns pipe with wrong angular sweep #6691

dovydasjaru opened this issue May 2, 2024 · 1 comment · Fixed by #6761
Assignees
Labels

Comments

@dovydasjaru
Copy link

dovydasjaru commented May 2, 2024

Describe the bug
TorusPipe creates a solid that is offset from the curve.

To Reproduce
code snippet:
TorusPipe.createAlongArc(curve, diameter / 2, true)

diameter = 0.009525
curve as json => {"center":[-0.0035718750000000004,0,0],"sweep":[0,90.0050353193204],"vector0":[-0.001190625,0.127,0],"vector90":[0.001190625,7.776507174585693e-18,0.127]}

Expected behavior
TorusPipe creates a solid that is along the curve.

Screenshots
image
In the screenshot there are four curves making a full circle. But it is visible that part of TorusPipe is outside the curve.

Desktop:

  • OS: Windows 11
  • Node version v18.17.1
  • iTwin.js Version 4.4.9
@dovydasjaru dovydasjaru changed the title TorusPipe creates a solid that is offset along a curve TorusPipe creates a solid that is offset along an Arc3d May 7, 2024
@dassaf4 dassaf4 self-assigned this May 9, 2024
@dassaf4
Copy link
Member

dassaf4 commented May 21, 2024

Ultimately the code is failing because the Arc3d is not circular, and TorusPipe assumes circularity. (The arc's vector0 and vector90 are not perpendicular; they are 90.0050353193204 degrees apart.) If you want to avoid the issue now, ensure your input arc is circular, perhaps by using a different constructor that guarantees a circular Arc3d. The fix will enforce circularity of the input arc, so YMMV.

@dassaf4 dassaf4 changed the title TorusPipe creates a solid that is offset along an Arc3d TorusPipe.createAlongArc returns pipe with wrong angular sweep May 24, 2024
@dassaf4 dassaf4 linked a pull request May 30, 2024 that will close this issue
@dassaf4 dassaf4 closed this as completed May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants