trimesh.constants module¶
- class trimesh.constants.ResolutionPath(seg_frac: float = 0.05, seg_angle: float = 0.08, max_sections: float = 500.0, min_sections: float = 20.0, export: str = '0.10f')¶
Bases:
object
- res.seg_fracfloat
When discretizing curves, what percentage of the drawing scale should we aim to make a single segment
- res.seg_anglefloat
When discretizing curves, what angle should a section span
- res.max_sectionsint
When discretizing splines, what is the maximum number of segments per control point
- res.min_sectionsint
When discretizing splines, what is the minimum number of segments per control point
- res.exportstr
Format string to use when exporting floating point vertices
- __init__(seg_frac: float = 0.05, seg_angle: float = 0.08, max_sections: float = 500.0, min_sections: float = 20.0, export: str = '0.10f') None ¶
- export: str = '0.10f'¶
- max_sections: float = 500.0¶
- min_sections: float = 20.0¶
- seg_angle: float = 0.08¶
- seg_frac: float = 0.05¶
- class trimesh.constants.ToleranceMesh(zero: float = np.float64(1e-13), merge: float = 1e-08, planar: float = 1e-05, facet_threshold: int = 5000, strict: bool = False)¶
Bases:
object
ToleranceMesh objects hold tolerance information about meshes.
- Parameters:
tol.zero (float) – Floating point numbers smaller than this are considered zero
tol.merge (float) – When merging vertices, consider vertices closer than this to be the same vertex. Here we use the same value (1e-8) as SolidWorks uses, according to their documentation.
tol.planar (float) – The maximum distance from a plane a point can be and still be considered to be on the plane
tol.facet_threshold (float) – Threshold for two facets to be considered coplanar
tol.strict (bool) – If True, run additional in- process checks (slower)
- __init__(zero: float = np.float64(1e-13), merge: float = 1e-08, planar: float = 1e-05, facet_threshold: int = 5000, strict: bool = False) None ¶
- facet_threshold: int = 5000¶
- merge: float = 1e-08¶
- planar: float = 1e-05¶
- strict: bool = False¶
- zero: float = np.float64(1e-13)¶
- class trimesh.constants.TolerancePath(zero: float = 1e-12, merge: float = 1e-05, planar: float = 1e-05, seg_frac: float = 0.125, seg_angle: float = 0.8726646259971648, seg_angle_min: float = 0.017453292519943295, seg_angle_frac: float = 0.5, aspect_frac: float = 0.1, radius_frac: float = 0.02, radius_min: float = 0.0001, radius_max: float = 50.0, tangent: float = 0.3490658503988659, strict: bool = False)¶
Bases:
object
TolerancePath objects contain tolerance information used in Path objects.
- Parameters:
tol.zero (float) – Floating point numbers smaller than this are considered zero
tol.merge (float) – When merging vertices, consider vertices closer than this to be the same vertex. Here we use the same value (1e-8) as SolidWorks uses, according to their documentation.
tol.planar (float) – The maximum distance from a plane a point can be and still be considered to be on the plane
tol.seg_frac (float) –
- When simplifying line segments what percentage of the drawing
scale can a segment be and have a curve fitted
tol.seg_angle (float) – When simplifying line segments to arcs, what angle can a segment span to be acceptable.
tol.aspect_frac (float) – When simplifying line segments to closed arcs (circles) what percentage can the aspect ratio differfrom 1:1 before escaping the fit early
tol.radius_frac (float) – When simplifying line segments to arcs, what percentage of the fit radius can vertices deviate to be acceptable
tol.radius_min – When simplifying line segments to arcs, what is the minimum radius multiplied by document scale for an acceptable fit
tol.radius_max – When simplifying line segments to arcs, what is the maximum radius multiplied by document scale for an acceptable fit
tol.tangent – When simplifying line segments to curves, what is the maximum angle the end sections can deviate from tangent that is acceptable.
- __init__(zero: float = 1e-12, merge: float = 1e-05, planar: float = 1e-05, seg_frac: float = 0.125, seg_angle: float = 0.8726646259971648, seg_angle_min: float = 0.017453292519943295, seg_angle_frac: float = 0.5, aspect_frac: float = 0.1, radius_frac: float = 0.02, radius_min: float = 0.0001, radius_max: float = 50.0, tangent: float = 0.3490658503988659, strict: bool = False) None ¶
- aspect_frac: float = 0.1¶
- merge: float = 1e-05¶
- property merge_digits: int¶
- planar: float = 1e-05¶
- radius_frac: float = 0.02¶
- radius_max: float = 50.0¶
- radius_min: float = 0.0001¶
- seg_angle: float = 0.8726646259971648¶
- seg_angle_frac: float = 0.5¶
- seg_angle_min: float = 0.017453292519943295¶
- seg_frac: float = 0.125¶
- strict: bool = False¶
- tangent: float = 0.3490658503988659¶
- zero: float = 1e-12¶
- trimesh.constants.log_time(method)¶
A decorator for methods which will time the method and then emit a log.debug message with the method name and how long it took to execute.