Hollow Profile as Extrusion Rhinocommon C#

Hi,

I would have a short question…if I take two nested curves (a hollow profile with a thickness) or one closed curve:

and I extrude them, in both cases, the result will be an Extrusion type.

image

I am not sure how to replicate that in code for the hollow profile…I am aware of all the solutions that would result in a Brep, but I cannot find one that would result in an Extrusion. Extrusion.Create only takes a single curve as input, so I am wondering if there is a method I am missing.

I saw there is a “Pipe” option but I am interested in different forms:

Thanks.
Milos

It seems you can create it from the outer profile and later ad inner holes:

  private void RunScript(Curve outer, List<Curve> inners, ref object A){
    Rhino.Geometry.Extrusion ex = Rhino.Geometry.Extrusion.Create(outer, 10.0, true);
    foreach(Curve inner in inners){
      ex.AddInnerProfile(inner);
    }
    A = ex;
  }

Inner holes are used as trims in UV space of the initial outer profile:

I don’t know how to make “sheared” extrusions like in your picture. That seems more like a Brep…

Sheared extrusion you can make by applying a Transform.Shear Method transformation:

With complex profiles

2 Likes

Thanks! This works, although I must admit it is a bit weird “how” it works…that you cannot simply select the curves that are in space but in the XY plane. with some kind of UV transformation. The image in the picture was not a sheared extrusion…it is just a stronger perspective.