MCPcopy
hub / github.com/CadQuery/cadquery / computeMass

Method computeMass

cadquery/occ_impl/shapes.py:816–828  ·  view source on GitHub ↗

Calculates the 'mass' of an object. :param obj: Compute the mass of this object :param tol: Numerical integration tolerance (optional).

(obj: Shape, tol: float | None = None)

Source from the content-addressed store, hash-verified

814
815 @staticmethod
816 def computeMass(obj: Shape, tol: float | None = None) -> float:
817 """
818 Calculates the 'mass' of an object.
819
820 :param obj: Compute the mass of this object
821 :param tol: Numerical integration tolerance (optional).
822 """
823 Properties = GProp_GProps()
824 calc_function = Shape._mass_calc_function(obj)
825
826 calc_function(obj.wrapped, Properties, *((tol,) if tol else ()))
827
828 return Properties.Mass()
829
830 @staticmethod
831 def centerOfMass(obj: Shape) -> Vector:

Callers 2

CombinedCenterMethod · 0.80
VolumeMethod · 0.80

Calls 1

_mass_calc_functionMethod · 0.80

Tested by

no test coverage detected