Cut line with volume (dynamo geometry)

Hi,
I`ve build a script to trim the segment of a line that intersects with a volume.
First it creates a surface from the line, then it subtracts the volume from the surface and then intersect the trimmed surface with the original line. The result is a trimmed line by volume. Although it works, it feels a bit like a workaround. Is there an easier way to do this?

if Geometry.DoesIntersect(gevelspouwblad.Dyn_Wallvolume,lijn):

if Geometry.Intersect(gevelspouwblad.Dyn_Wallvolume,lijn).Equals(lijn):continue

else:

	Dyn_Wallsurface = Autodesk.DesignScript.Geometry.Curve.Extrude(lijn,Vector.ZAxis(),500)
			
	Dyn_Wallsurface_Getrimd = Autodesk.DesignScript.Geometry.Surface.SubtractFrom(Dyn_Wallsurface, gevelspouwblad.Dyn_Wallvolume)
	
	Lijn_Getrimd = Geometry.Intersect(Dyn_Wallsurface_Getrimd[0],lijn)

Hi,

I personally use BiMorph… Curve.SolidIntersect

Hope that helps,

Mark

2 Likes

thanks.
Im curious how it works. It doesnt seem to be programmed in python.