Function ExtrudeShape
-
ExtrudeShape(
name: string,
options: {
adjustFrame?: boolean;
backUVs?: Vector4;
cap?: number;
capFunction?: Nullable<(shapePath: Vector3[]) => Vector3[]>;
closePath?: boolean;
closeShape?: boolean;
firstNormal?: Vector3;
frontUVs?: Vector4;
instance?: Mesh;
invertUV?: boolean;
path: Vector3[];
rotation?: number;
scale?: number;
shape: Vector3[];
sideOrientation?: number;
updatable?: boolean;
},
scene?: Nullable<Scene>,
): MeshParameters
- name: string
defines the name of the mesh
- options: {
adjustFrame?: boolean;
backUVs?: Vector4;
cap?: number;
capFunction?: Nullable<(shapePath: Vector3[]) => Vector3[]>;
closePath?: boolean;
closeShape?: boolean;
firstNormal?: Vector3;
frontUVs?: Vector4;
instance?: Mesh;
invertUV?: boolean;
path: Vector3[];
rotation?: number;
scale?: number;
shape: Vector3[];
sideOrientation?: number;
updatable?: boolean;
}defines the options used to create the mesh
- scene: Nullable<Scene> = null
defines the hosting scene
Returns Mesh
the extruded shape mesh
- name: string
Creates an extruded shape mesh. The extrusion is a parametric shape. It has no predefined shape. Its final shape will depend on the input parameters.
shapeis a required array of successive Vector3. This array depicts the shape to be extruded in its local space : the shape must be designed in the xOy plane and will be extruded along the Z axis.pathis a required array of successive Vector3. This is the axis curve the shape is extruded along.rotation(float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve.scale(float, default 1) is the value to scale the shape.closeShape(boolean, default false) closes the shape when true, since v5.0.0.closePath(boolean, default false) closes the path when true and no caps, since v5.0.0.capsets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALLinstanceis an instance of an existing ExtrudedShape object to be updated with the passedshape,path,scaleorrotationparameters : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#extruded-shapefrontUVsandbackUVs(Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientationinvertUV(boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.updatable(default false) if its internal geometry is supposed to change once created.firstNormal(Vector3) defines the direction of the first normal of the supplied path. Consider using this for any path that is straight, and particular for paths in the xy plane.adjustFrame(boolean, default false) will cause the internally generated Path3D tangents, normals, and binormals to be adjusted so that a) they are always well-defined, and b) they do not reverse from one path point to the next. This prevents the extruded shape from being flipped and/or rotated with resulting mesh self-intersections. This is primarily useful for straight paths that can reverse direction.