CreateContourCurves seperate inner and outer curves

I dont find any way to seperate inner and outer curves after creating ConturCurves with:


I already have tried to check the CurveOrientation but it doesnt seems to be right.

As an “complex” object i have add an jpg

and an .3dm file example.3dm (102.5 KB)

Hello - see


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:

# add the new extrusion to the document
exId = sc.doc.Objects.AddExtrusion(ex)


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?