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

Add Axis3d.intersectionWithSketchPlane #124

Open
MartinSStewart opened this issue Jan 13, 2020 · 1 comment
Open

Add Axis3d.intersectionWithSketchPlane #124

MartinSStewart opened this issue Jan 13, 2020 · 1 comment

Comments

@MartinSStewart
Copy link

I've found it helpful to have the following function.

{-| Try to find the unique intersection point of an axis with a sketch plane. If the axis does not intersect the sketch plane, or if it is coplanar with it (lying perfectly in the sketch plane), returns Nothing.
-}
intersectionWithSketchPlane : SketchPlane3d units coordinates { defines : coordinates2d } -> Axis3d units coordinates -> Maybe (Point2d units coordinates2d)
intersectionWithSketchPlane sketchPlane axis3d =
    Axis3d.intersectionWithPlane (SketchPlane3d.toPlane sketchPlane) axis3d |> Maybe.map (Point3d.projectInto sketchPlane)

It behaves the same way as Axis3d.intersectionWithPlane except that it returns a 2d point on the sketch plane rather than a 3d point in global coordinates.

@ianmackenzie
Copy link
Owner

I like it, makes sense! Will throw that in when I get a chance...

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

No branches or pull requests

2 participants