Extrusion ========= .. py:module:: rhino3dm .. py:class:: Extrusion .. py:method:: Extrusion() Extrusion constructor .. py:attribute:: PathStart rhino3dm.Point3d: Gets the start point of the path. .. py:attribute:: PathEnd rhino3dm.Point3d: Gets the end point of the path. .. py:attribute:: PathTangent rhino3dm.Vector3d: Gets the up vector of the path. .. py:attribute:: 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 .. py:attribute:: 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 .. py:attribute:: IsMiteredAtStart bool: Returns a value indicating whether a miter plane at start is defined. .. py:attribute:: IsMiteredAtEnd bool: Gets a value indicating whether a miter plane at the end is defined. .. py:attribute:: IsSolid bool: Gets a value indicating whether there is no gap among all surfaces constructing this object. .. py:attribute:: IsCappedAtBottom bool: Gets a value indicating whether the surface that fills the bottom profile is existing. .. py:attribute:: IsCappedAtTop bool: Gets a value indicating whether the surface that fills the top profile is existing. .. py:attribute:: CapCount int: Gets the amount of capping surfaces. .. py:attribute:: ProfileCount int: Gets the amount of profile curves. .. py:staticmethod:: Create(planarCurve, height, cap) Creates an extrusion of a 3d curve (which must be planar) and a height. :param rhino3dm.Curve planarCurve: Planar curve used as profile :param float height: 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. :param bool cap: If the curve is closed and cap is true, then the resulting extrusion is capped. :return: If the input is valid, then a new extrusion is returned. Otherwise None is returned :rtype: Extrusion .. py:staticmethod:: CreateBoxExtrusion(box, cap) Gets an extrusion from a box. :param rhino3dm.Box box: IsValid must be true. :param bool cap: If true, the base and the top of the box will be capped. Defaults to true. :return: Extrusion on success. None on failure. :rtype: Extrusion .. py:staticmethod:: CreateCylinderExtrusion(cylinder, capBottom, capTop) Gets an extrusion form of a cylinder. :param Cylinder cylinder: IsFinite must be true. :param bool capBottom: If true, the end at cylinder.Height1 will be capped. :param bool capTop: If true, the end at cylinder.Height2 will be capped. :return: Extrusion on success. None on failure. :rtype: Extrusion .. py:staticmethod:: CreatePipeExtrusion(cylinder, otherRadius, capBottom, capTop) Gets an extrusion form of a pipe. :param Cylinder cylinder: IsFinite must be true. :param float otherRadius: If cylinder.Radius is less than other radius, then the cylinder will be the inside \ of the pipe. :param bool capBottom: If true, the end at cylinder.Height1 will be capped. :param bool capTop: If true, the end at cylinder.Height2 will be capped. :return: Extrusion on success. None on failure. :rtype: Extrusion .. py:method:: 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. :param bool splitKinkyFaces: If True and the profiles have kinks, then the faces corresponding to those profiles are split \ so they will be G1. :return: A brep with a similar shape like this extrusion, or None on error. :rtype: rhino3dm.Brep .. py:method:: SetPathAndUp() Allows to set the two points at the extremes and the up vector. :param rhino3dm.Point3d a: The start point. :param rhino3dm.Point3d b: The end point. :param rhino3dm.Vector3d up: The up vector. :return: True if the operation succeeded; otherwise false. \ Setting up=a-b will make the operation fail. :rtype: bool .. py:method:: GetProfileTransformation(s) Gets the transformation that maps the XY profile curve to its 3d location. :param float s: 0.0 = starting profile \ 1.0 = ending profile. :return: A Transformation. The transform is Invalid on failure. :rtype: Transform .. py:method:: GetProfilePlane(s) Gets the 3D plane containing the profile curve at a normalized path parameter. :param float s: 0.0 = starting profile \ 1.0 = ending profile. :return: A plane. The plane is Invalid on failure. :rtype: rhino3dm.Plane .. py:method:: GetPathPlane(s) Gets the 3D plane perpendicular to the path at a normalized path parameter. :param float s: 0.0 = starting profile \ 1.0 = ending profile. :return: A plane. The plane is Invalid on failure. :rtype: rhino3dm.Plane .. py:method:: SetOuterProfile(outerProfile, cap) Sets the outer profile of the extrusion. :param rhino3dm.Curve outerProfile: curve in the XY plane or a 2D curve. :param bool cap: If outerProfile is a closed curve, then cap determines if the extrusion \ has end caps. If outerProfile is an open curve, cap is ignored. :return: 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. :rtype: bool .. py:method:: AddInnerProfile(innerProfile) Adds an inner profile. :param rhino3dm.Curve innerProfile: Closed curve in the XY plane or a 2d curve. :return: True if the profile was set. :rtype: bool .. py:method:: Profile3d(profileIndex, s) Gets a transversal isocurve of the extruded profile. :param int profileIndex: 0 <= profileIndex < ProfileCount \ The outer profile has index 0. :param float s: 0.0 <= s <= 1.0 \ A relative parameter controlling which profile is returned. \ 0 = bottom profile and 1 = top profile. :return: The profile. :rtype: rhino3dm.Curve .. py:method:: Profile3d(ci) Gets a transversal isocurve of the extruded profile. :param int profileIndex: 0 <= profileIndex < ProfileCount \ The outer profile has index 0. :param float s: 0.0 <= s <= 1.0 \ A relative parameter controlling which profile is returned. \ 0 = bottom profile and 1 = top profile. :return: The profile. :rtype: rhino3dm.Curve .. py:method:: WallEdge(ci) Gets one of the longitudinal curves along the beam or extrusion. :param ComponentIndex ci: The index of this profile. :return: The profile. :rtype: rhino3dm.Curve .. py:method:: WallSurface(ci) Gets one of the longitudinal surfaces of the extrusion. :param ComponentIndex ci: The index specifying which precise item to retrieve. :return: The surface. :rtype: rhino3dm.Surface .. py:method:: PathLineCurve() Gets the line-like curve that is the conceptual axis of the extrusion. :return: The path as a line curve. :rtype: LineCurve .. py:method:: ProfileIndex(profileParameter) Gets the index of the profile curve at a domain related to a parameter. :param float profileParameter: Parameter on profile curve. :return: -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. :rtype: int .. py:method:: GetMesh(meshType) Obtains a reference to a specified type of mesh for this extrusion. :param MeshType meshType: The mesh type. :return: A mesh. :rtype: rhino3dm.Mesh .. py:method:: SetMesh(mesh, meshType) Sets a specified type of mesh for this extrusion. :param rhino3dm.Mesh mesh: The mesh. :param MeshType meshType: The mesh type. :return: True on success. :rtype: bool