Extrusion problem with inner curves

Hy,
I am having troubles when creating a extrusion profile.
When I add curves as inner profiles these will translate to somehwere else when performing the extrusion:

curves:

extrusion:

the code is as follows:

ObjRef thisCrv = RS.GetObject(“outer crv”, Rhino.DocObjects.ObjectType.Curve);
ObjRef crv1 = RS.GetObject(“inner crv”, Rhino.DocObjects.ObjectType.Curve);
ObjRef crv2 = RS.GetObject(“inner crv”, Rhino.DocObjects.ObjectType.Curve);

Extrusion newExtr = Extrusion.Create(thisCrv.Curve(), 100, true);
newExtr.AddInnerProfile(crv1.Curve());
newExtr.AddInnerProfile(crv2.Curve());
doc.Objects.AddExtrusion(newExtr);

Does anybody have an idea how to solve this?

Here is an example that you might find useful.

https://github.com/dalefugier/SampleCsCommands/blob/master/SampleCsExtrusion.cs

1 Like

Hy Dale, thanks so much fpr the reply. This was very useful.
Now in the meantime I learned how extrusions work… They are quite tricky I have to say.

Hi Dale, I have the same confusion here, but the link to epiphany is not working anymore…
Fabian

https://github.com/mcneel/rhino-developer-samples/blob/6/rhinocommon/cs/SampleCsCommands/SampleCsExtrusion.cs

– Dale

1 Like

Dale, wow you’re quick… thanks a lot!

So, “Closed curve in the XY plane or a 2d curve.” means the inner profiles need to be oriented in the XY-plane relative to the XY-space of the outer profile! I had them all in the XY-plane, but didn’t realize that the outer profile defines the parameter space for all of the profiles in the extrusion. Makes sense now but almost drove me nuts… merci! (opens a beer)