I have a bsplinesurface that I've constructed from a set of points. I also have a point inside the XY bounds of the surface and I want to find the corresponding Z coordinate on the surface.
If I construct a line that runs through X,Y,0 and X,Y,1, Can I find where that line intersects the surface?
intersect bsplinesurface and line [solved]
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
intersect bsplinesurface and line [solved]
Last edited by sliptonic on Wed Sep 19, 2018 6:08 pm, edited 1 time in total.
Re: intersect bsplinesurface and line
Something like this ? :
Code: Select all
bs = Part.BSplineSurface()
pt = FreeCAD.Vector(0.2,0.6,100.)
vertical_line = Part.Line(pt, pt+FreeCAD.Vector(0,0,1))
# intersectCS() : Returns all intersection points and curve segments between the curve and the surface.
points, curves = vertical_line.intersectCS(bs)
points
# [<Point (0.2,0.6,0) >]
curves
# []
- sliptonic
- Veteran
- Posts: 3460
- Joined: Tue Oct 25, 2011 10:46 pm
- Location: Columbia, Missouri
- Contact:
Re: intersect bsplinesurface and line
Exactly like that. Thanks Chris_G.