Tree — leaf nodes

Primitive and data leaves. Compositing layouts are under Tree — composition nodes.

class pyvcad.Function

A function geometry primitive/leaf node. This is analogous to an F-rep. Functions can be defined in Cartesian, cylindrical, or spherical coordinates.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.Function, function: str, material: typing.SupportsInt = 1, min: pyvcad.pyvcad.Vec3 = <pyvcad.pyvcad.Vec3 object at 0x106ce9ef0>, max: pyvcad.pyvcad.Vec3 = <pyvcad.pyvcad.Vec3 object at 0x106ce9f30>) -> None

Constructor that takes a function to evaluate, a material, and bounding box.

Parameters:
  • function (string) – The function expression to evaluate. This can be any math expression, such as x^2 + y^2 + z^2 - 1.

  • material (uint8_t) – The material for the function.

  • min (glm::vec3) – The minimum bounding box coordinates.

  • max (glm::vec3) – The maximum bounding box coordinates.

Example

>>> from libvcad import pyvcad as pv
>>> function = pv.Function('x^2 + y^2 + z^2 - 1', 1, pv.vec3(-10.0, -10.0, -10.0), pv.vec3(10.0, 10.0, 10.0))
  1. __init__(self: pyvcad.pyvcad.Function, function: collections.abc.Callable[[typing.SupportsFloat, typing.SupportsFloat, typing.SupportsFloat, typing.SupportsFloat, typing.SupportsFloat, typing.SupportsFloat, typing.SupportsFloat, typing.SupportsFloat], float], material: typing.SupportsInt = 1, min: pyvcad.pyvcad.Vec3 = <pyvcad.pyvcad.Vec3 object at 0x106cea1f0>, max: pyvcad.pyvcad.Vec3 = <pyvcad.pyvcad.Vec3 object at 0x106cea230>) -> None

Constructor that takes a native python function to evaluate, a material id, and bounding box.

Parameters:
  • function (function<double(double x, double y, double z, double rho, double phic, double r, double theta, double phis)>) – The function to evaluate. This must return the signed distance to the surface. The function must take three parameters (all vec3): xyz, cylindrical coordinates, and spherical coordinates. You may use those to compute the signed distance.

  • material (uint8_t) – The material for the function.

  • min (glm::vec3) – The minimum bounding box coordinates.

  • max (glm::vec3) – The maximum bounding box coordinates.

Example

>>> from libvcad import pyvcad as pv
>>> def my_function(x, y, z, rho, phic, r, theta, phis):
>>>     return x**2 + y**2 + z**2 - 1
>>> function = pv.Function(my_function, 1, pv.vec3(-10.0, -10.0, -10.0), pv.vec3(10.0, 10.0, 10.0))
class pyvcad.Mesh

A mesh geometry primitive/leaf node. The mesh is loaded from a file and converted into a signed distance field using OpenVDB.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.Mesh, path: str, material: typing.SupportsInt = 1, disable_validation: bool = False) -> None

Constructor. Creates a Mesh with a file path and material.

Parameters:
  • path (string) – The path to the mesh file to load.

  • material – The material of the mesh.

  1. __init__(self: pyvcad.pyvcad.Mesh, path: str, sample_size: pyvcad.pyvcad.Vec3, material: typing.SupportsInt = 1, disable_validation: bool = False) -> None

Constructor. Creates a Mesh with a file path, sample size, and material.

Parameters:
  • path (string) – The path to the mesh file to load.

  • sample_size (glm::vec3) – The size of each voxel in the grid. Make this your sample size if your are missing small mesh features

  • material – The material of the mesh.

  1. __init__(self: pyvcad.pyvcad.Mesh, mesh: SurfaceMesh, material: typing.SupportsInt = 1) -> None

Constructor. Creates a Mesh with a SurfaceMesh and material.

Parameters:
  • mesh (SurfaceMesh) – The mesh to load.

  • material (uint8_t) – The material of the mesh.

  1. __init__(self: pyvcad.pyvcad.Mesh, path: str, override_voxel_size: typing.SupportsFloat, material: typing.SupportsInt = 1, disable_validation: bool = False) -> None

Constructor. Creates a Mesh with a file path and an explicit voxel size for SDF voxelization, bypassing the minimum bound heuristic.

Parameters:
  • path (string) – The path to the mesh file to load.

  • override_voxel_size (float) – The explicit voxel size to use when voxelizing the mesh into an SDF.

  • material (uint8_t) – The material of the mesh.

  • disable_validation (bool) – Defaults to false. If true, the mesh will not be validated for errors.

class pyvcad.PointMap

A leaf node that represents simulation results that are imported. This class is used to import simulation results from external files and map a multi-material distribution them as a design. The simulation results must be stored in a tetrahedral mesh saved as a .inp file and a displacement field saved as a .csv file. This class assumes nodal displacements are stored in the displacement field file and that the indices of the nodes in the tetrahedral mesh correspond to the indices of the nodes in the displacement field file. The displacement field file must have the following format (where xyz is the coordinates of the node and uvw is the displacement vector): x1, y1, z1, u1, v1, w1, x2, y2, z2, u2, v2, w2, … The tetrahedral mesh file must be an Abaqus .inp file using C3D4 elements. The point map can be used to evaluate functions at any point in space by interpolating the simulation results. However, the material distribution is only available within the tetrahedral mesh. Likewise, the signed distance returned by the evaluate() function is simple point membership. Mapping functions are defined using the exprtk library and are similar to the f_grade() node. When sampling a point in space, the following variables are available in math expressions: - x, y, z: The coordinates of the point - rho, phic, r: The cylindrical coordinates of the point - theta, phis: The spherical coordinates of the point - dx, dy, dz: The displacement vector at the point - len: The length of the displacement vector. Similar to f_grade(), each function defined must also have a corresponding material id defined with it. When sampled using distribution() the volume fractions/ probability density is returned as evaluated by the functions. The point map can be used in probability mode where the material() function uses the material distribution as a probability masses and returns a random material id based on the distribution. Threshold mode is also available where the material() function returns the material id with the highest probability mass. Note: This class only supports tetrahedral meshes and displacement fields.

__init__(self: pyvcad.pyvcad.PointMap, mesh_path: str, tet_mesh_path: str, displacement_field_path: str, functions: collections.abc.Sequence[str], materials: collections.abc.Sequence[SupportsInt], prob_mode: bool) None

Constructor. Creates a PointMap with a tetrahedron mesh file path, displacement field file path, functions, materials, and probability mode.

Parameters:
  • mesh_path (std::string) – The path to the surface mesh file.

  • tet_mesh_path (std::string) – The path to the tetrahedron mesh file (INP).

  • displacement_field_path (std::string) – The path to the displacement field file (CSV).

  • functions (std::vector<std::string>) – The functions to evaluate, similar to F-reps or F-grades. These functions map the displacement field to multi-material distribution.

  • materials (std::vector<uint8_t>) – The materials for the functions.

  • prob_mode (bool) – The probability mode of the functions. When sampled using distribution() the volume fractions/ probability density is returned as evaluated by the functions. The point map can be used in probability mode where the material() function uses the material distribution as a probability masses and returns a random material id based on the distribution. Threshold mode is also available where the material() function returns the material id with the highest probability mass.

Example

>>> from libvcad import pyvcad as pv
>>> functions = ['x + y + z', 'x * y * z']
>>> materials = [1, 2]
>>> point_map = pv.PointMap('path/to/meshfile.inp', 'path/to/displacementfile.csv', functions, materials, True)
class pyvcad.RectPrism

A rectangular prism leaf node/geometric primitive. This node is a rectangular prism with a center point, size, and material ID.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.RectPrism) -> None

Default constructor. Creates a RectPrism with a center of (0, 0, 0), size of (1, 1, 1), and material id of 1.

Example

>>> from libvcad import pyvcad as pv
>>> rect_prism = pv.RectPrism()
  1. __init__(self: pyvcad.pyvcad.RectPrism, center: pyvcad.pyvcad.Vec3, size: pyvcad.pyvcad.Vec3, material: typing.SupportsInt = 1) -> None

Constructor. Creates a RectPrism with a center, size, and material id.

Parameters:
  • center (vec3) – The center point of the RectPrism.

  • size (vec3) – The side length of the RectPrism.

  • material (uint8_t) – The material id of the RectPrism.

Example

>>> from libvcad import pyvcad as pv
>>> center = pv.vec3(0, 0, 0)
>>> size = pv.vec3(2, 2, 2)
>>> rect_prism = pv.RectPrism(center, size, 1)
class pyvcad.Sphere

A sphere leaf node/geometric primitive. This node is a sphere with a center point, radius, and material ID.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.Sphere) -> None

Default constructor. Creates a Sphere with a center of (0, 0, 0), radius of 1, and material id of 1.

Example

>>> from libvcad import pyvcad as pv
>>> sphere = pv.Sphere()
  1. __init__(self: pyvcad.pyvcad.Sphere, cx: typing.SupportsFloat, cy: typing.SupportsFloat, cz: typing.SupportsFloat, radius: typing.SupportsFloat, material: typing.SupportsInt = 1) -> None

Constructor. Creates a Sphere with a center, radius, and material id.

Parameters:
  • cx (double) – The x coordinate of the center point of the Sphere.

  • cy (double) – The y coordinate of the center point of the Sphere.

  • cz (double) – The z coordinate of the center point of the Sphere.

  • radius (double) – The radius of the Sphere.

  • material (uint8_t) – The material id of the Sphere.

Example

>>> from libvcad import pyvcad as pv
>>> sphere = pv.Sphere(0, 0, 0, 5, 1)
  1. __init__(self: pyvcad.pyvcad.Sphere, center: pyvcad.pyvcad.Vec3, radius: typing.SupportsFloat, material: typing.SupportsInt = 1) -> None

Constructor. Creates a Sphere with a center, radius, and material id.

Parameters:
  • center (vec3) – The center point of the Sphere.

  • radius (double) – The radius of the Sphere.

  • material (uint8_t) – The material id of the Sphere.

Example

>>> from libvcad import pyvcad as pv
>>> center = pv.vec3(0, 0, 0)
>>> sphere = pv.Sphere(center, 5, 1)
class pyvcad.Strut

A leaf node that represents a strut.

__init__(self: pyvcad.pyvcad.Strut, start: pyvcad.pyvcad.Vec3, end: pyvcad.pyvcad.Vec3, radius: SupportsFloat, material: SupportsInt = 1) None

Constructor. Creates a Strut with a start point, end point, radius, and material ID.

Parameters:
  • start (vec3) – The start point of the strut.

  • end (vec3) – The end point of the strut.

  • radius (double) – The radius of the strut.

  • material (uint8_t) – The material ID for the strut.

Example

>>> from libvcad import pyvcad as pv
>>> start = pv.vec3(0, 0, 0)
>>> end = pv.vec3(1, 1, 1)
>>> strut = pv.Strut(start, end, 0.5, 1)
class pyvcad.Voxels

A leaf node/geometric primitive that contains a voxel grid, which can be loaded from disk or generated from an equation. Voxels are stored in an OpenVDB grid.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.Voxels, file_path: str, voxel_size: pyvcad.pyvcad.Vec3, min: pyvcad.pyvcad.Vec3, material_defs: MaterialDefs) -> None

Constructor. Creates Voxels with a file path, voxel size, minimum coordinate of the grid, and material definitions.

Parameters:
  • file_path (string) – The path to the file from which to load the voxel grid.

  • voxel_size (vec3) – The size of each voxel in the grid. It doesn’t need to match what you sample, and can be asymmetric.

  • min (vec3) – The minimum coordinate of the grid.

  • material_defs (MaterialDefs) – A pointer to the material definitions. Required to convert material values in the grid into OpenVCAD material values.

Example

>>> from libvcad import pyvcad as pv
>>> material_defs = pv.MaterialDefs()
>>> voxels = pv.Voxels('path/to/voxelgrid.vdb', pv.vec3(0.1, 0.1, 0.1), pv.vec3(0, 0, 0), material_defs)
  1. __init__(self: pyvcad.pyvcad.Voxels, voxel_size: pyvcad.pyvcad.Vec3, min: pyvcad.pyvcad.Vec3) -> None

Constructor. Creates Voxels with voxel size and minimum coordinate of the grid.

Parameters:
  • voxel_size (vec3) – The size of each voxel in the grid. It doesn’t need to match what you sample, and can be asymmetric.

  • min (vec3) – The minimum coordinate of the grid.

Example

>>> from libvcad import pyvcad as pv
>>> voxels = pv.Voxels(pv.vec3(0.1, 0.1, 0.1), pv.vec3(0, 0, 0))
populate_with_equation(self: pyvcad.pyvcad.Voxels, equation: str, min: pyvcad.pyvcad.Vec3, max: pyvcad.pyvcad.Vec3, voxel_size: pyvcad.pyvcad.Vec3) None

Populates the grid with a VDB file.

Parameters:
  • equation (string) – The equation to populate the grid.

  • min (vec3) – The minimum coordinate of the grid.

  • max (vec3) – The maximum coordinate of the grid.

  • voxel_size (vec3) – The size of each voxel in the grid. It doesn’t need to match what you sample, and can be asymmetric.

Example

>>> from libvcad import pyvcad as pv
>>> voxels.populate_with_equation('x^2 + y^2 + z^2 - 1', pv.vec3(0, 0, 0), pv.vec3(1, 1, 1), pv.vec3(0.1, 0.1, 0.1))
populate_with_png_stack(self: pyvcad.pyvcad.Voxels, dir: str, min: pyvcad.pyvcad.Vec3, voxel_size: pyvcad.pyvcad.Vec3) None

Populates the grid with a PNG stack given a directory. The PNG files are assumed to be named in order (i.e. 001.png, 002.png, etc.). The material values are converted to OpenVCAD material values using the material definitions.

Parameters:
  • dir (string) – The directory containing the PNG files.

  • min (vec3) – The minimum coordinate of the grid.

  • voxel_size (vec3) – The size of each voxel in the grid. It doesn’t need to match what you sample, and can be asymmetric.

Example

>>> from libvcad import pyvcad as pv
>>> voxels.populate_with_png_stack('path/to/png_stack', pv.vec3(0, 0, 0), pv.vec3(0.1, 0.1, 0.1))
save_to_file(self: pyvcad.pyvcad.Voxels, file_path: str) None

Saves the grid to a VDB file.

Parameters:

file_path (string) – The path to the VDB file to save the grid.

Example

>>> from libvcad import pyvcad as pv
>>> voxels.save_to_file('path/to/savefile.vdb')
class pyvcad.CAD

A CAD geometry primitive/leaf node. The CAD is loaded from a file into memory for sampling. The node supports .STEP and .igs files. NOTE: using fast mode will convert the CAD model into a mesh for faster sampling. This hurts acuracy but dramatically speeds up performance. For the Inkjet compiler fast mode is recommended.

__init__(self: pyvcad.pyvcad.CAD, path: str, use_fast_mode: bool = True, material: SupportsInt = 1) None

Constructor that takes a path to the CAD file to load, whether to use fast mode, and the material of the CAD.

Parameters:
  • path (string) – The path to the CAD file to load.

  • use_fast_mode (bool) – Whether to use fast mode.

  • material (uint8_t) – The material of the CAD.

Example

>>> from libvcad import pyvcad as pv
>>> cad = pv.CAD('path/to/cadfile.step', True, 1)
class pyvcad.Cylinder

A cylinder leaf node/ geometric primitive. The cylinder is aligned along the Z-axis, standing upright, and centered at (0,0,0).

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.Cylinder) -> None

Default constructor. Creates a Cylinder with a center of (0,0,0), radius of 1, height of 1, and material id of 1.

Example

>>> from libvcad import pyvcad as pv
>>> cylinder = pv.Cylinder()
  1. __init__(self: pyvcad.pyvcad.Cylinder, center: pyvcad.pyvcad.Vec3, radius: typing.SupportsFloat, height: typing.SupportsFloat, material: typing.SupportsInt = 1) -> None

Constructor. Creates a Cylinder with a center, radius, height, and material id.

Parameters:
  • center (vec3) – The center point of the Cylinder.

  • radius (double) – The radius of the Cylinder.

  • height (double) – The height of the Cylinder.

  • material (uint8_t) – The material id of the Cylinder.

Example

>>> from libvcad import pyvcad as pv
>>> center = pv.vec3(0, 0, 0)
>>> cylinder = pv.Cylinder(center, 2, 5, 1)
class pyvcad.GraphLattice

A graph lattice leaf node. This class represents a lattice structure defined by a set of edges and a radius for the struts.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.GraphLattice, edges: collections.abc.Sequence[tuple[pyvcad.pyvcad.Vec3, pyvcad.pyvcad.Vec3]], radius: typing.SupportsFloat, material: typing.SupportsInt) -> None

Constructor. Creates a GraphLattice with edges, radius, and material.

Parameters:
  • edges (List[Tuple[Vec3, Vec3]]) – The edges of the lattice.

  • radius (float) – The radius of the struts.

  • material (uint8_t) – The material ID of the lattice.

Example

>>> from libvcad import pyvcad as pv
>>> edges = [(pv.vec3(0, 0, 0), pv.vec3(1, 1, 1))]
>>> graph_lattice = pv.GraphLattice(edges, 0.5, 1)
  1. __init__(self: pyvcad.pyvcad.GraphLattice, type: pyvcad.pyvcad.LatticeType, size: pyvcad.pyvcad.Vec3, radius: typing.SupportsFloat, material: typing.SupportsInt) -> None

Constructor. Creates a GraphLattice with a lattice type, size, radius, and material.

Parameters:
  • type (LatticeType) – The type of the lattice (BodyCenteredCubic, FaceCenteredCubic, Cubic, or KelvinCell).

  • size (Vec3) – The size of the lattice unit cell.

  • radius (float) – The radius of the struts.

  • material (uint8_t) – The material ID of the lattice.

Example

>>> from libvcad import pyvcad as pv
>>> size = pv.vec3(1, 1, 1)
>>> graph_lattice = pv.GraphLattice(pv.LatticeType.BodyCenteredCubic, size, 0.5, 1)
class pyvcad.Text

A text leaf node which generates a 3D text object by extruding the text along the Z-axis. The node takes a string, height, depth, material id, font aspect, font name, and alignment options. The CAD part is created from the provided text.

__init__(self: pyvcad.pyvcad.Text, text: str, height: SupportsFloat, depth: SupportsFloat, material: SupportsInt = 1, aspect: pyvcad.pyvcad.FontAspect = <FontAspect.Regular: 0>, font: str = 'Consolas', h_align: pyvcad.pyvcad.HorizontalAlignment = <HorizontalAlignment.Center: 1>, v_align: pyvcad.pyvcad.VerticalAlignment = <VerticalAlignment.Center: 1>) None

Constructor. Creates a Text node with the provided text content, height, depth, material id, font aspect, font name and alignment options.

Parameters:
  • text (str) – The text content for the 3D text.

  • height (float) – The height of the text.

  • depth (float) – The extrusion depth of the text.

  • material (int, optional) – The material id of the text node. Defaults to 1.

  • aspect (FontAspect, optional) – The font aspect. Defaults to FontAspect.Regular.

  • font (str, optional) – The name of the font to use. Defaults to Consolas.

  • h_align (HorizontalAlignment, optional) – Horizontal alignment of the text. Defaults to Center.

  • v_align (VerticalAlignment, optional) – Vertical alignment of the text. Defaults to Center.

bounding_box(self: pyvcad.pyvcad.Text) tuple[pyvcad.pyvcad.Vec3, pyvcad.pyvcad.Vec3]

Computes the axis-aligned bounding box of the text node.

Returns:

A pair of vec3 objects representing the minimum and maximum points of the bounding box.

Return type:

tuple

clone(self: pyvcad.pyvcad.Text) pyvcad.pyvcad.Node

Creates a deep copy of the text node.

distribution(self: pyvcad.pyvcad.Text, arg0: SupportsFloat, arg1: SupportsFloat, arg2: SupportsFloat) dict[int, float]

Provides the material distribution at a given point.

Parameters:
  • x (float) – X-coordinate.

  • y (float) – Y-coordinate.

  • z (float) – Z-coordinate.

Returns:

A dictionary with the material id as key and occupancy as value if the point is inside; otherwise, an empty dict.

Return type:

dict

evaluate(self: pyvcad.pyvcad.Text, arg0: SupportsFloat, arg1: SupportsFloat, arg2: SupportsFloat) float

Evaluates the text node at a given coordinate to compute the signed distance to the surface.

Parameters:
  • x (float) – X-coordinate.

  • y (float) – Y-coordinate.

  • z (float) – Z-coordinate.

Returns:

The signed distance from the point to the text surface.

Return type:

float

material_list(self: pyvcad.pyvcad.Text) list[int]

Returns a list containing the material id associated with this text node.

prepare(self: pyvcad.pyvcad.Text, arg0: pyvcad.pyvcad.Vec3, arg1: SupportsFloat, arg2: SupportsFloat) None

Prepares the text node by generating its CAD representation.

Parameters:
  • voxel_size (vec3) – The voxel size of the grid.

  • interior_bandwidth (float) – The interior bandwidth for calculations.

  • exterior_bandwidth (float) – The exterior bandwidth for calculations.

class pyvcad.SignedDistanceField

Represents a signed distance field using OpenVDB.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.SignedDistanceField, material: typing.SupportsInt = 1) -> None

  2. __init__(self: pyvcad.pyvcad.SignedDistanceField, grid: openvdb::v13_0::Grid<openvdb::v13_0::tree::Tree<openvdb::v13_0::tree::RootNode<openvdb::v13_0::tree::InternalNode<openvdb::v13_0::tree::InternalNode<openvdb::v13_0::tree::LeafNode<float, 3u>, 4u>, 5u>>>>, material: typing.SupportsInt = 1) -> None

  3. __init__(self: pyvcad.pyvcad.SignedDistanceField, occupancy_grid: openvdb::v13_0::Grid<openvdb::v13_0::tree::Tree<openvdb::v13_0::tree::RootNode<openvdb::v13_0::tree::InternalNode<openvdb::v13_0::tree::InternalNode<openvdb::v13_0::tree::LeafNode<bool, 3u>, 4u>, 5u>>>>, material: typing.SupportsInt = 1) -> None

bounding_box(self: pyvcad.pyvcad.SignedDistanceField) tuple[pyvcad.pyvcad.Vec3, pyvcad.pyvcad.Vec3]
clone(self: pyvcad.pyvcad.SignedDistanceField) pyvcad.pyvcad.Node
distribution(self: pyvcad.pyvcad.SignedDistanceField, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) dict[int, float]
evaluate(self: pyvcad.pyvcad.SignedDistanceField, x: SupportsFloat, y: SupportsFloat, z: SupportsFloat) float
material_list(self: pyvcad.pyvcad.SignedDistanceField) list[int]
prepare(self: pyvcad.pyvcad.SignedDistanceField, voxel_size: pyvcad.pyvcad.Vec3, interior_bandwidth: SupportsFloat, exterior_bandwidth: SupportsFloat) None
save_openvdb_grid(self: pyvcad.pyvcad.SignedDistanceField, file_path: str) None
class pyvcad.PolygonExtrude

An extruded polygon leaf node/geometric primitive. Takes a planar polygon defined by 3D vertices and extrudes it along its computed normal (right-hand rule) by a given height.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pyvcad.pyvcad.PolygonExtrude) -> None

Default constructor. Creates a unit square in the XY plane extruded 1 unit in +Z.

Example

>>> from libvcad import pyvcad as pv
>>> poly = pv.PolygonExtrude()
  1. __init__(self: pyvcad.pyvcad.PolygonExtrude, vertices: collections.abc.Sequence[pyvcad.pyvcad.Vec3], height: typing.SupportsFloat, symmetric: bool = False, material: typing.SupportsInt = 1) -> None

Constructor. Creates an extruded polygon from coplanar 3D vertices.

Parameters:
  • vertices (list[Vec3]) – The vertices of the planar polygon (minimum 3, must be coplanar).

  • height (float) – The extrusion distance along the polygon normal.

  • symmetric (bool) – If True, extrudes height/2 on each side of the polygon plane.

  • material (int) – The material id of the PolygonExtrude.

Example

>>> from libvcad import pyvcad as pv
>>> verts = [pv.Vec3(0,0,0), pv.Vec3(10,0,0), pv.Vec3(10,10,0), pv.Vec3(0,10,0)]
>>> poly = pv.PolygonExtrude(verts, 5.0, False, 1)
class pyvcad.Map

Maps a surface parameterization onto a closed mesh.

__init__(self: pyvcad.pyvcad.Map, surface_path: str, closed_mesh_path: str) None

Constructor with surface and closed mesh paths.

Parameters:
  • surface_path (str) – Path to the surface file.

  • closed_mesh_path (str) – Path to the closed mesh file.