Geometric properties#

The pyvcad_metamaterials.properties module measures finished designs and ideal strut unit cells without a solver: relative density, porosity, surface area, cross-sections, connectivity, and strut metrics. Lengths are in millimetres.

pyvcad_metamaterials.properties.characterize(root, voxel_size, bounds=None, compute_connectivity=True, periodic_axes=())[source]#

Characterize any OpenVCAD node using a mesh and a uniform SDF grid.

Lengths are in millimetres, areas in square millimetres, volumes in cubic millimetres, and ratios are dimensionless unless their name states otherwise. Smaller voxel_size values improve fidelity at additional runtime and memory cost.

pyvcad_metamaterials.properties.characterize_mesh(mesh, bounds=None, boundary_tolerance=None)[source]#

Characterize a closed pv.SurfaceMesh inside a rectangular envelope.

surface_area includes all triangles. interface_area excludes triangles lying on an envelope face, which removes artificial caps created where a periodic structure is clipped to its unit-cell boundary.

pyvcad_metamaterials.properties.characterize_graph_cell(cell, cell_size, beam_radius)[source]#

Characterize a named or custom strut unit-cell graph exactly.

aspect_ratio is L / (2r). slenderness_ratio is L / r_g for a solid circular strut, where r_g = r / 2 and therefore L / r_g = 2L/r.

class pyvcad_metamaterials.properties.GeometricProperties(bounds, envelope_size, envelope_volume, solid_volume, surface_area, interface_area, centroid, mesh_vertex_count, mesh_edge_count, mesh_triangle_count, surface_component_count, euler_characteristic, genus, is_closed, voxel_size=None, periodic_axes=(), cross_sections=None, solid_component_count=None)[source]#

Geometric measurements derived from a closed triangle surface mesh.

bounds#

Analysis envelope as ((x0, y0, z0), (x1, y1, z1)) in mm.

centroid#

Centroid of the solid (x, y, z) in mm.

cross_sections#

CrossSectionProfile per axis name (characterize() only), else empty.

envelope_size#

Envelope edge lengths (x, y, z) in mm.

envelope_volume#

Envelope volume in mm^3.

euler_characteristic#

Mesh Euler characteristic V - E + F.

genus#

Total genus of a closed mesh, or None when the mesh is open or the value is not an integer.

hydraulic_diameter#

4 * void_volume / interface_area in mm, or None with no interface.

interface_area#

surface_area without triangles lying on an envelope face.

Type:

Solid-void interface area in mm^2

interface_area_to_solid_volume#

interface_area / solid_volume in 1/mm, or None for zero volume.

is_closed#

True when every mesh edge is shared by exactly two triangles.

mesh_edge_count#

Number of unique mesh edges.

mesh_triangle_count#

Number of mesh triangles.

mesh_vertex_count#

Number of mesh vertices used by triangles.

normalized_interface_area#

interface_area / envelope_volume^(2/3), dimensionless.

periodic_axes#

Axes treated as periodic when counting solid components.

porosity#

One minus the relative density.

relative_density#

Solid volume divided by envelope volume.

solid_component_count#

Number of 26-connected solid pieces in the voxel grid (characterize() only), else None.

solid_volume#

Solid volume in mm^3.

specific_surface_area#

interface_area / envelope_volume in 1/mm.

surface_area#

Area of every mesh triangle in mm^2, including caps on the envelope faces.

surface_area_to_solid_volume#

surface_area / solid_volume in 1/mm, or None for zero volume.

surface_component_count#

Number of connected surface pieces in the mesh.

void_volume#

Envelope volume minus solid volume in mm^3 (at least 0).

voxel_size#

Sampling voxel size in mm (characterize() only), else None.

class pyvcad_metamaterials.properties.GraphProperties(name, cell_size, beam_radius, node_count, strut_count, component_count, degrees, strut_lengths)[source]#

Exact geometric and connectivity measurements for a strut unit cell.

aspect_ratios#

L/D of every strut.

beam_radius#

Strut radius in mm.

cell_size#

Cell size (x, y, z) in mm.

component_count#

Number of connected components of the strut graph.

cycle_rank#

strut_count - node_count + component_count.

Type:

Independent cycles

degree_histogram#

Map from coordination number (struts per node) to node count.

maximum_aspect_ratio#

Largest strut L/D.

maximum_degree#

Largest coordination number.

maximum_slenderness_ratio#

Largest strut L/r_g.

maximum_strut_length#

Longest strut in mm.

mean_aspect_ratio#

Mean strut L/D.

mean_degree#

Mean coordination number.

mean_slenderness_ratio#

Mean strut L/r_g.

mean_strut_length#

Mean strut length in mm.

minimum_aspect_ratio#

Smallest strut length / diameter (L/D).

minimum_degree#

Smallest coordination number.

minimum_slenderness_ratio#

Smallest strut length / radius of gyration (L/r_g, with r_g = r/2).

minimum_strut_length#

Shortest strut in mm.

name#

Name of the characterized unit cell.

node_count#

Number of nodes (strut end points) in the cell.

slenderness_ratios#

L/r_g of every strut.

strut_count#

Number of struts in the cell.

strut_lengths#

Length of every strut in mm.

total_strut_length#

Sum of strut lengths in mm.

class pyvcad_metamaterials.properties.CrossSectionProfile(axis, positions, solid_areas, area_fractions)[source]#

Directional solid-area samples through a voxelized design.

area_fractions#

Solid fraction of each section, in [0, 1].

axis#

‘x’, ‘y’ or ‘z’.

Type:

Axis normal to the sections

coefficient_of_variation#

Standard deviation of the fractions divided by their mean; None when the mean is 0.

maximum_area_fraction#

Largest section fraction, or None with no sections.

mean_area_fraction#

Mean section fraction, or None with no sections.

minimum_area_fraction#

Smallest section fraction, or None with no sections.

positions#

Section positions along the axis in mm (voxel centres).

solid_areas#

Solid area of each section in mm^2.