I dont find any way to seperate inner and outer curves after creating ConturCurves with:
Brep.CreateContourCurves(…)
I already have tried to check the CurveOrientation but it doesnt seems to be right.
As an “complex” object i have add an jpg
I dont find any way to seperate inner and outer curves after creating ConturCurves with:
Brep.CreateContourCurves(…)
I already have tried to check the CurveOrientation but it doesnt seems to be right.
As an “complex” object i have add an jpg
Hello - see
-Pascal
Thanks a lot, that was what i was looking for. But now im dont understand howto create a Extrusion with an inner and outer curve and an defined height.
I allready have tried to Extrusion.AddInnerProfile(curve) to an new Extrusion and an Extrusion.Create(curve,height,true) without success.
Whats the correct way to get a valid Extrusion with one outer and one or more inner curves and a definded height?
Hello - see if this helps
import Rhino
import scriptcontext as sc
#Assuming you have the curves sorted, get a plane from the outer curve
rc,crvPlane = sortedCurves[0].TryGetPlane()
#find the xform for the interior loops- they need to be added in the XY plane
xform = Rhino.Geometry.Transform.PlaneToPlane(crvPlane, Rhino.Geometry.Plane.WorldXY)
# flip the direction if the base-curve plane is antiparallel to the bb base plane
if crvPlane.ZAxis.IsParallelTo(plane1.ZAxis)== -1: height = -height
#create the extrusion from the first curve in the list (outer curve)
ex = Rhino.Geometry.Extrusion.Create(sortedCurves.pop(0), height, brep.IsSolid)
# add any interior curves
if len(sortedCurves) > 0:
for crv in sortedCurves:
crv.Transform(xform)
ex.AddInnerProfile(crv)
# add the new extrusion to the document
exId = sc.doc.Objects.AddExtrusion(ex)
sc.doc.Views.Redraw()
-Pascal
Thanks the Plane-Transformation was the key. But saddly i dont understand why this is needed. Chould someone explane me the backgroud as simple as possible?
I dont need it at the moment but what plane do you mean with plane1?