skppy.data_structure.construction¶
Construction geometry, camera, and georeferenced shadow settings.
Guide points, guide lines, and section planes live in an
Entities scope. Cameras and
ShadowInfo are model metadata. Positions and distances use SketchUp’s
native inch unit; direction vectors are unitless.
Example
import skppy
model = skppy.new_model()
model.entities.guide_points.append(
skppy.GuidePoint(id=1, position=skppy.Vector3D(12, 0, 0))
)
model.cameras.append(
skppy.Camera(
eye=skppy.Vector3D(120, 120, 96),
target=skppy.Vector3D(0, 0, 0),
)
)
- class skppy.data_structure.construction.Camera[source]
Bases:
objectA SketchUp camera (saved view).
Positions are stored in SketchUp internal units (inches). Use a scale factor when converting to Blender.
- eye
Camera position
(x, y, z)in inches.- Type:
Vector3D
- target
Look-at point
(x, y, z)in inches.- Type:
Vector3D
- up
Up direction unit vector
(x, y, z).- Type:
Vector3D
- fov
Field of view in degrees (vertical if
fov_is_height, otherwise horizontal). Default 35.0.- Type:
float
- fov_is_height
If True,
fovis vertical FOV; otherwise horizontal.- Type:
bool
- is_perspective
True for perspective, False for parallel/ortho projection.
- Type:
bool
- near
Near clipping distance (inches). Default 1.0.
- Type:
float
- far
Far clipping distance (inches). Default 10000.0.
- Type:
float
- name
Optional camera/scene name.
- Type:
str
- ortho_height
Parallel-projection viewport height (inches).
- Type:
float or None
- aspect_ratio
Viewport aspect ratio (width / height).
- Type:
float or None
- legacy_flag
Legacy camera flag (0x34C7).
- Type:
bool
- image_width
Camera image width (0x34C9).
- Type:
float or None
- is_2d
Whether the camera is in 2-D mode (0x34CA).
- Type:
bool
- scale_2d
2-D camera scale factor (0x34CB).
- Type:
float or None
- center_2d_x
2-D camera center X (0x34CC).
- Type:
float or None
- center_2d_y
2-D camera center Y (0x34CD).
- Type:
float or None
- allow_clipping
Whether clipping is allowed in parallel projection (0x34CE).
- Type:
bool
- __init__(eye: Vector3D = <factory>, target: Vector3D = <factory>, up: Vector3D = <factory>, fov: float = 35.0, fov_is_height: bool = True, is_perspective: bool = True, near: float = 1.0, far: float = 10000.0, name: str = '', ortho_height: float | None = None, aspect_ratio: float | None = None, legacy_flag: bool = False, image_width: float | None = None, is_2d: bool = False, scale_2d: float | None = None, center_2d_x: float | None = None, center_2d_y: float | None = None, allow_clipping: bool = True) None
- class skppy.data_structure.construction.GuideLine[source]
Bases:
objectA construction guide line (SUGuideLine).
Guide lines are infinite or finite reference lines. They are stored in the TAG_GUIDE_LINES (0x1391) section of the entities block.
- id
Entity ID extracted from the entity base record.
- Type:
int
- point
A point on the line
(x, y, z)in SketchUp inches.- Type:
tuple of float or Vector3D
- direction
Direction vector
(dx, dy, dz)(unit vector).- Type:
tuple of float or Vector3D
- stipple_pattern
16-bit line stipple pattern used to draw the guide.
- Type:
int
- start_parameter, end_parameter
Bounds along the unit direction.
-1e30/+1e30represent an infinite line; finite bounds preserve construction segments.- Type:
float
- layer_id
Owning layer/tag ID.
- Type:
int or None
- __init__(id: int = 0, point: Tuple[float, float, float] | ~skppy.data_structure.primitives.Vector3D=<factory>, direction: Tuple[float, float, float] | ~skppy.data_structure.primitives.Vector3D=<factory>, stipple_pattern: int = 0, start_parameter: float = -1e+30, end_parameter: float = 1e+30, layer_id: int | None = None) None
- class skppy.data_structure.construction.GuidePoint[source]
Bases:
objectA construction guide point (SUGuidePoint).
Guide points are reference points that can be placed in the model to assist with precision modeling. They are stored in the TAG_GUIDE_POINTS (0x1392) section of the entities block.
- id
Entity ID extracted from the entity base record.
- Type:
int
- position
3-D position
(x, y, z)in SketchUp inches.- Type:
tuple of float or Vector3D
- reference_point
Optional endpoint of the construction segment drawn to the guide point.
- Type:
tuple of float or Vector3D, optional
- layer_id
Owning layer/tag ID.
- Type:
int or None
- __init__(id: int = 0, position: Tuple[float, float, float] | ~skppy.data_structure.primitives.Vector3D=<factory>, reference_point: Tuple[float, float, float] | ~skppy.data_structure.primitives.Vector3D | None=None, layer_id: int | None = None) None
- class skppy.data_structure.construction.SectionPlane[source]
Bases:
objectA section plane (SUSectionPlane).
Section planes define a cutting plane that can hide geometry on one side. They are stored in the TAG_SECTION_PLANES (0x1393) section of the entities block.
- id
Entity ID extracted from the entity base record.
- Type:
int
- plane
Plane equation
(a, b, c, d)whereax + by + cz + d = 0.- Type:
tuple of float
- name
Display name of the section plane.
- Type:
str
- symbol
Symbol string (often empty).
- Type:
str
- layer_id
Owning layer/tag ID.
- Type:
int or None
- __init__(id: int = 0, plane: Tuple[float, float, float, float] = (0.0, 0.0, 1.0, 0.0), name: str = '', symbol: str = '', layer_id: int | None = None) None
- class skppy.data_structure.construction.ShadowInfo[source]
Bases:
objectGeo-referenced shadow settings (SUShadowInfo).
Stored in the TAG_SHADOW_INFO_BLOCK (0x0204) section of model.dat. Contains location, time, and display settings for shadow calculation.
- latitude
Latitude in degrees.
- Type:
float
- longitude
Longitude in degrees.
- Type:
float
- time
Time value (compact int, internal representation).
- Type:
int
- daylight_savings
Whether daylight savings time is active.
- Type:
bool
- city
Raw city name bytes (encoding unresolved).
- Type:
bytes
- country
Raw UTF-8 country name bytes.
- Type:
bytes
- timezone_offset
Timezone offset in hours.
- Type:
float
- north_direction
North direction vector
(x, y, z)in model space.- Type:
tuple of float
- display_shadows
Whether shadows are displayed.
- Type:
bool
- display_north
Whether the north direction is displayed.
- Type:
bool
- display_on_all_faces
Whether shadows are cast on all faces.
- Type:
bool
- display_on_ground_plane
Whether shadows are cast on the ground plane.
- Type:
bool
- edges_cast_shadows
Whether edges cast shadows.
- Type:
bool
- light
Light intensity (compact int).
- Type:
int
- dark
Dark intensity (compact int).
- Type:
int
- use_sun_for_all_shading
Whether the sun is used for all shading.
- Type:
bool
- __init__(latitude: float = 0.0, longitude: float = 0.0, time: int = 0, daylight_savings: bool = False, city: bytes = b'', country: bytes = b'', timezone_offset: float = 0.0, north_direction: Tuple[float, float, float] = (0.0, 0.0, 0.0), display_shadows: bool = False, display_north: bool = False, display_on_all_faces: bool = False, display_on_ground_plane: bool = False, edges_cast_shadows: bool = False, light: int = 0, dark: int = 0, use_sun_for_all_shading: bool = False) None