CSGModel

class compas_gmsh.models.CSGModel(tree, name, **kwargs)

Bases: Model

Model for shape generation through Constructive Solid Geometry.

Parameters:
treedict

The CSG tree as a dictionary mapping operations to operands. The operations have to be one of {"union", "intersection", "difference"}. The operands have to be lists of shapes or lists of dicts that are CSG trees themselves. At every level of the tree, there can be only one operation.

namestr

The name of the model.

Attributes:
treedict

The CSG tree as a dictionary mapping operations to operands. The operations have to be one of {"union", "intersection", "difference"}. The operands have to be lists of shapes or lists of dicts that are CSG trees themselves. At every level of the tree, there can be only one operation.

Methods

add

Add a shape to the underlying OCC model.

compute_tree

Comute the compound shape resulting from the operations on shape primitives in the tree.

Inherited Methods

curve_coordinates_at

Get the coordinates of a point on a curve in the model.

curve_domain

Get the domain of a curve in the model.

curve_to_polyline

Get the coordinates of a point on a curve in the model.

curve_vertices

Get the vertices of a curve.

find_points_at_xy

Find the model points at or close to a spatial location.

find_points_at_xyz

Find the model points at or close to a spatial location.

from_brep

Construct a model from a Brep.

from_step

Construc a model from the data contained in a STEP file.

generate_mesh

Generate a mesh of the current model.

heal

Heal the underlying OCC model.

mesh_node_xyz

Get the coordinates of the mesh nodes.

mesh_targetlength_at_point

Set the target length at a particular mesh point.

mesh_to_compas

Convert the model mesh to a COMPAS mesh data structure.

mesh_to_openmesh

Convert the model mesh to a COMPAS mesh data structure.

mesh_to_quads

Convert the model mesh to a list of quads.

mesh_to_tets

Convert the model mesh to a COMPAS mesh data structure.

mesh_to_triangles

Convert the model mesh to a list of triangles.

mesh_to_vertices_and_faces

Convert the model mesh to a COMPAS mesh data structure.

optimize_mesh

Optimize the model mesh using the specified method.

point_coordinates

Get the coordinates of a point in the model.

point_to_point

Get the coordinates of a point in the model.

recombine_mesh

Recombine the mesh into quadrilateral faces.

refine_mesh

Refine the model mesh by uniformly splitting the edges.

surface_coordinates_at

Get the coordinates of a point on a surface in the model.

surface_curves

Get the boundary curves of a surface in the model.

surface_domain

Get the domain of a surface in the model.

surface_faces

Get the faces of a surface.

surface_mesh

Get the mesh of a surface entity.

surface_vertices

Get the vertices of a surface.

synchronize

Syncronize the geometry with the underlying OCC model.

volume_curves

Get the curves of a volume in the model.

volume_faces

Get the faces of a volume.

volume_mesh

Get the mesh of a volume entity.

volume_points

Get the points of a volume in the model.

volume_surfaces

Get the surfaces of a volume in the model.

volume_tets

Get the tetrahedra of a volume entity.

volume_vertices

Get the vertices of a volume.