Skip to content

Create a workplane perpendicular to a line #1596

Answered by lorenzncode
Jopie01 asked this question in Q&A
Discussion options

You must be logged in to vote

Here is an example (free function API in master branch):

import cadquery as cq
from cadquery.occ_impl.shapes import *

pts = [(10, 10, 0), (20, 10, 10), (30, 10, -10), (30, 0, 0)]

path = spline(pts)
# create plane at start of path with normal tangent to path
plane = cq.Plane(origin=path.startPoint(), normal=path.tangentAt(0))
profile = cq.Workplane(plane).polygon(3, 1).val()
sweep = sweep(profile, path, True)

In your case with the path Edge in Workplane:

import cadquery as cq

path = (cq.Workplane("YZ")
        .transformed(offset=(-200, -30, 340))
        .lineTo(3896, 2310)
        )

plane = cq.Plane(origin=path.val().endPoint(), normal=path.val().tangentAt(1))
p = cq.Workplane(plane).r…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Jopie01
Comment options

Answer selected by Jopie01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants