pyvista_cad.CadMultiBlockAccessor#
- class CadMultiBlockAccessor(dataset)[source]#
The
.cadaccessor on everypyvista.MultiBlock.Assembly-aware: walks the hierarchy, filters by metadata, flattens, and dumps a pure-data view of the tree.
- Parameters:
- datasetpyvista.MultiBlock
MultiBlock this accessor is bound to.
- Parameters:
dataset (MultiBlock)
Examples
>>> import pyvista as pv >>> import pyvista_cad >>> pv.MultiBlock().cad.source_format is None True
- __init__(dataset)[source]#
- Parameters:
dataset (MultiBlock)
- Return type:
None
Methods
__init__(dataset)Return a pure-data view of the MultiBlock hierarchy.
cad_view(**kwargs)Resolve to a
{'faces', 'edges'}CAD-view MultiBlock.drop_spatial_outliers(*[, threshold, min_blocks])Return a copy with spatial-outlier leaf blocks removed.
Sum exact volume across all BREP-cached leaves.
find([predicate, name, ifc_type, layer, ...])Filter the MultiBlock tree.
flatten()Collapse a nested MultiBlock into a flat MultiBlock of leaves.
Fuse the entire MultiBlock into one
pyvista.PolyData.plot(**kwargs)CAD-friendly plot: shaded faces + topological edges.
set_metadata(*[, units, label, color, ...])Write the standard
cad.*metadata onto this MultiBlock.set_units(target, *[, convert])Update
cad.unitson every block, optionally rescaling points.split_by_color([color_array])Combine and split into one block per per-cell color.
split_by_label([label_array])Combine the assembly, then split by per-cell label value.
split_by_layer([layer_array])Combine and split into one block per layer.
tessellate(*[, linear_deflection, ...])Re-tessellate the combined assembly from its cached B-rep.
to_3mf(path, /, *[, units])Write to
pathas a 3MF file.to_brep(path, /)Write to
pathas a faceted BREP file.Wrap as a faceted
build123d.Compound.Wrap as a faceted
cadquery.Workplane.to_dxf(path, /, *[, layer, layer_array, ...])Write this MultiBlock as a DXF file.
to_gltf(path, /)Write to
pathas a glTF / GLB file.to_gmsh(*[, model_name])Install this MultiBlock as the current gmsh model.
to_step(path, /)Write to
pathas a faceted STEP file.Build a faceted
TopoDSshape from the combined assembly.walk()Walk the MultiBlock tree depth-first.
Attributes
colorDataset-level RGB color, or
None.has_brep_originWhether this dataset has a recoverable B-rep origin.
labelDataset-level label, or
None.layersSorted unique DXF / cell-data layer names.
metadataLive
CadMetadataview.source_formatOriginating CAD format ('STEP', 'DXF', ...) or
None.tessellation_qualityTessellation deflections last used to build this mesh.
unitsCanonical unit string or
None.