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

Should .location_at(t) use FrameMethod.CORRECTED by default? #903

Open
snoyer opened this issue Feb 15, 2025 · 0 comments
Open

Should .location_at(t) use FrameMethod.CORRECTED by default? #903

snoyer opened this issue Feb 15, 2025 · 0 comments
Labels
enhancement New feature or request occt A bug with the OpenCascade CAD core

Comments

@snoyer
Copy link
Contributor

snoyer commented Feb 15, 2025

.location_at(t) and therefore curve ^ t currently use FrameMethod.FRENET by default but FrameMethod.CORRECTED can give nicer results, see following example:

Image

  • top: curve ^ t
  • bottom: curve.location_at(t, frame_method=FrameMethod.CORRECTED)
from build123d import FrameMethod, Spline
from numpy import linspace

from ocp_vscode import show_all


path = Spline(
    (-40, 0.0, 0.0),
    (-10, 5.0, 15.0),
    tangents=[(1, 0, 0), (1, 0, 0)],
)

frames = [path ^ t for t in linspace(0, 1, 20)]

path = path.translate((0, 0, -10))
frames_corrected = [
    path.location_at(t, frame_method=FrameMethod.CORRECTED) for t in linspace(0, 1, 20)
]

show_all()

This should just be a matter of changing the default value, however there seems to be an OCCT bug where a loop will not terminate for some curves (upstream issue: Open-Cascade-SAS/OCCT#370). For example:

from build123d import FrameMethod, Spline
from numpy import linspace

path = Polyline((-10, -70, 0), (0, -70, 0), (0, -70, -20), (0, -60, -20))

frames = [path ^ t for t in linspace(0, 1, 20)] # ok

frames_corrected = [
    path.location_at(t, frame_method=FrameMethod.CORRECTED) for t in linspace(0, 1, 20)
] # hangs
@gumyr gumyr added the enhancement New feature or request label Feb 15, 2025
@gumyr gumyr added this to the Not Gating Release 1.0.0 milestone Feb 15, 2025
@gumyr gumyr added the occt A bug with the OpenCascade CAD core label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request occt A bug with the OpenCascade CAD core
Projects
None yet
Development

No branches or pull requests

2 participants