Extrusion

class rhino3dm.Extrusion
Extrusion()

Extrusion constructor

PathStart

rhino3dm.Point3d: Gets the start point of the path.

PathEnd

rhino3dm.Point3d: Gets the end point of the path.

PathTangent

rhino3dm.Vector3d: Gets the up vector of the path.

MiterPlaneNormalAtStart

rhino3dm.Vector3d: Gets or sets the normal of the miter plane at the start in profile coordinates. In profile coordinates, 0,0,1 always maps to the extrusion axis

MiterPlaneNormalAtEnd

rhino3dm.Vector3d: Gets or sets the normal of the miter plane at the end in profile coordinates. In profile coordinates, 0,0,1 always maps to the extrusion axis

IsMiteredAtStart

bool: Returns a value indicating whether a miter plane at start is defined.

IsMiteredAtEnd

bool: Gets a value indicating whether a miter plane at the end is defined.

IsSolid

bool: Gets a value indicating whether there is no gap among all surfaces constructing this object.

IsCappedAtBottom

bool: Gets a value indicating whether the surface that fills the bottom profile is existing.

IsCappedAtTop

bool: Gets a value indicating whether the surface that fills the top profile is existing.

CapCount

int: Gets the amount of capping surfaces.

ProfileCount

int: Gets the amount of profile curves.

static Create(planarCurve, height, cap)

Creates an extrusion of a 3d curve (which must be planar) and a height.

Parameters:
  • planarCurve (rhino3dm.Curve) – Planar curve used as profile
  • height (float) – If the height > 0, the bottom of the extrusion will be in plane and the top will be height units above the plane. If the height < 0, the top of the extrusion will be in plane and the bottom will be height units below the plane. The plane used is the one that is returned from the curve’s TryGetPlane function.
  • cap (bool) – If the curve is closed and cap is true, then the resulting extrusion is capped.
Returns:

If the input is valid, then a new extrusion is returned. Otherwise None is returned

Return type:

Extrusion

static CreateBoxExtrusion(box, cap)

Gets an extrusion from a box.

Parameters:
  • box (rhino3dm.Box) – IsValid must be true.
  • cap (bool) – If true, the base and the top of the box will be capped. Defaults to true.
Returns:

Extrusion on success. None on failure.

Return type:

Extrusion

static CreateCylinderExtrusion(cylinder, capBottom, capTop)

Gets an extrusion form of a cylinder.

Parameters:
  • cylinder (Cylinder) – IsFinite must be true.
  • capBottom (bool) – If true, the end at cylinder.Height1 will be capped.
  • capTop (bool) – If true, the end at cylinder.Height2 will be capped.
Returns:

Extrusion on success. None on failure.

Return type:

Extrusion

static CreatePipeExtrusion(cylinder, otherRadius, capBottom, capTop)

Gets an extrusion form of a pipe.

Parameters:
  • cylinder (Cylinder) – IsFinite must be true.
  • otherRadius (float) – If cylinder.Radius is less than other radius, then the cylinder will be the inside of the pipe.
  • capBottom (bool) – If true, the end at cylinder.Height1 will be capped.
  • capTop (bool) – If true, the end at cylinder.Height2 will be capped.
Returns:

Extrusion on success. None on failure.

Return type:

Extrusion

ToBrep(splitKinkyFaces)

Constructs a brep form of the extrusion. The outer profile is always the first face of the brep. If there are inner profiles, additional brep faces are created for each profile. If the outer profile is closed, then end caps are added as the last two faces of the brep.

Parameters:splitKinkyFaces (bool) – If True and the profiles have kinks, then the faces corresponding to those profiles are split so they will be G1.
Returns:A brep with a similar shape like this extrusion, or None on error.
Return type:rhino3dm.Brep
SetPathAndUp()

Allows to set the two points at the extremes and the up vector.

Parameters:
Returns:

True if the operation succeeded; otherwise false. Setting up=a-b will make the operation fail.

Return type:

bool

GetProfileTransformation(s)

Gets the transformation that maps the XY profile curve to its 3d location.

Parameters:s (float) – 0.0 = starting profile 1.0 = ending profile.
Returns:A Transformation. The transform is Invalid on failure.
Return type:Transform
GetProfilePlane(s)

Gets the 3D plane containing the profile curve at a normalized path parameter.

Parameters:s (float) – 0.0 = starting profile 1.0 = ending profile.
Returns:A plane. The plane is Invalid on failure.
Return type:rhino3dm.Plane
GetPathPlane(s)

Gets the 3D plane perpendicular to the path at a normalized path parameter.

Parameters:s (float) – 0.0 = starting profile 1.0 = ending profile.
Returns:A plane. The plane is Invalid on failure.
Return type:rhino3dm.Plane
SetOuterProfile(outerProfile, cap)

Sets the outer profile of the extrusion.

Parameters:
  • outerProfile (rhino3dm.Curve) – curve in the XY plane or a 2D curve.
  • cap (bool) – If outerProfile is a closed curve, then cap determines if the extrusion has end caps. If outerProfile is an open curve, cap is ignored.
Returns:

True if the profile was set. If the outer profile is closed, then the extrusion may also have inner profiles. If the outer profile is open, the extrusion may not have inner profiles. If the extrusion already has a profile, the set will fail.

Return type:

bool

AddInnerProfile(innerProfile)

Adds an inner profile.

Parameters:innerProfile (rhino3dm.Curve) – Closed curve in the XY plane or a 2d curve.
Returns:True if the profile was set.
Return type:bool
Profile3d(profileIndex, s)

Gets a transversal isocurve of the extruded profile.

Parameters:
  • profileIndex (int) – 0 <= profileIndex < ProfileCount The outer profile has index 0.
  • s (float) – 0.0 <= s <= 1.0 A relative parameter controlling which profile is returned. 0 = bottom profile and 1 = top profile.
Returns:

The profile.

Return type:

rhino3dm.Curve

Profile3d(ci)

Gets a transversal isocurve of the extruded profile.

Parameters:
  • profileIndex (int) – 0 <= profileIndex < ProfileCount The outer profile has index 0.
  • s (float) – 0.0 <= s <= 1.0 A relative parameter controlling which profile is returned. 0 = bottom profile and 1 = top profile.
Returns:

The profile.

Return type:

rhino3dm.Curve

WallEdge(ci)

Gets one of the longitudinal curves along the beam or extrusion.

Parameters:ci (ComponentIndex) – The index of this profile.
Returns:The profile.
Return type:rhino3dm.Curve
WallSurface(ci)

Gets one of the longitudinal surfaces of the extrusion.

Parameters:ci (ComponentIndex) – The index specifying which precise item to retrieve.
Returns:The surface.
Return type:rhino3dm.Surface
PathLineCurve()

Gets the line-like curve that is the conceptual axis of the extrusion.

Returns:The path as a line curve.
Return type:LineCurve
ProfileIndex(profileParameter)

Gets the index of the profile curve at a domain related to a parameter.

Parameters:profileParameter (float) – Parameter on profile curve.
Returns:-1 if profileParameter does not correspond to a point on the profile curve. When the profileParameter corresponds to the end of one profile and the beginning of the next profile, the index of the next profile is returned.
Return type:int
GetMesh(meshType)

Obtains a reference to a specified type of mesh for this extrusion.

Parameters:meshType (MeshType) – The mesh type.
Returns:A mesh.
Return type:rhino3dm.Mesh