skppy.utils

Utility helpers for working with parsed SketchUp models.

Functions

inches_to_meters : Convert SketchUp internal units to Blender meters. triangulate_face : Fan-triangulate a Face’s outer loop. transform_to_matrix4x4 : Convert SUTransformation 13-float list to a 4x4 matrix.

skppy.utils.inches_to_meters(value: float) float[source]

Convert SketchUp internal units (inches) to metres.

Parameters:

value (float) – Length in SketchUp inches.

Returns:

Length in metres.

Return type:

float

skppy.utils.meters_to_inches(value: float) float[source]

Convert metres to SketchUp internal units (inches).

Parameters:

value (float) – Length in metres.

Returns:

Length in SketchUp inches.

Return type:

float

skppy.utils.transform_to_matrix4x4(transform_13d: List[float]) List[List[float]][source]

Convert a 13-float SUTransformation to a 4x4 row-major matrix.

The 13-float layout is:

[m00, m01, m02,  m10, m11, m12,  m20, m21, m22,  tx, ty, tz,  w]
Parameters:

transform_13d (list of float) – 13-float SUTransformation.

Returns:

4x4 row-major matrix.

Return type:

list of list of float

skppy.utils.triangulate_face(face: Face, entities: Entities) List[Tuple[int, int, int]][source]

Fan-triangulate the outer loop of face.

Parameters:
  • face (Face to triangulate.)

  • entities (Entities object that owns the edges referenced by the face.)

Returns:

Vertex-ID triples forming triangles.

Return type:

list of (int, int, int)

Notes

This is a simple fan triangulation from the first vertex. Inner loops (holes) are not handled. For proper ear-clipping with hole support use skppy.triangulation.triangulate_face_3d().