compas_cadwork.scene
¤
Classes¤
BeamSceneObject
deprecated
¤
Deprecated
Subject to removal, avoid using
Scene object for COMPAS Timber Beam objects.
Parameters:
-
item(:class:`compas_timber.elements.Beam`) –The beam object.
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
CadworkSceneObject
deprecated
¤
CadworkSceneObject(item=None, name=None, color=None, opacity=1.0, show=True, transformation=None, context=None, **kwargs)
Deprecated
Subject to removal, avoid using
Base class for all of cadwork's SceneObject.
Attributes¤
DRAWN_ELEMENTS
class-attribute
instance-attribute
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Methods:¤
add_element
¤
add_element(element_id) -> Element
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Records the given element_id to track elements added by the
:class:~compas_cadwork.scene.CadworkSceneObject.
Parameters:
-
element_id(int) –The element ID to add to tracking.
clear
classmethod
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Removes all elements tracked by the :class:~compas_cadwork.scene.CadworkSceneObject from the
cadwork model.
Camera
deprecated
¤
Camera(frame: Frame, fov: float, fwidth: float, fheight: float, target: Point, projection_type: ProjectionType)
Deprecated
Subject to removal, avoid using
This class is a wrapper for cadwork's camera data which allows to get information and manipulate the camera settings in an object-oriented way.
..note:: While the cadwork document might use millimeters as the unit of length, the camera data is expected in meters. The caller is responsible for converting the data to the correct unit before passing it to the camera.
Parameters:
-
frame(Frame) –Position and orientation of the camera.
-
fov(float) –The field of view of the camera.
-
fwidth(float) –The field width of the camera.
-
fheight(float) –The field height of the camera.
-
target(Point) –The point the camera is looking at.
-
projection_type(ProjectionType) –The projection type of the camera.
Attributes:
-
frame(:class:`~compas.geometry.Frame`, read-only) –Position and orientation of the camera.
-
fov((float, read - only)) –The field of view of the camera.
-
fov_width((float, read - only)) –The field width of the camera.
-
fov_height((float, read - only)) –The field height of the camera.
-
position(Point) –The position of the camera.
-
target(Point) –The point the camera is looking at.
-
up_vector(Vector) –The up vector of the camera.
Examples:
>>> from compas_cadwork.scene import Camera
>>> camera = Camera.from_activedoc()
>>> camera.position
Point(0.0, 0.0, 0.0)
>>> # Set the camera position to the center of the active element and zoom to it:
>>> length = element.length * 0.001
>>> target = element.midpoint * 0.001
>>> location = target + element.frame.zaxis * length
>>> camera = Camera.from_activedoc()
>>> camera.look_at(target, up_vector=element.frame.xaxis)
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
-
API Reference
scene ClassesCamera Methods:from_activedoc
Attributes¤
__data__
property
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
fov_height
property
¤
fov_height: float
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
fov_width
property
¤
fov_width: float
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
position
property
writable
¤
position: Point
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
target
property
writable
¤
target: Point
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
up_vector
property
¤
up_vector: Vector
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Methods:¤
apply_camera
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Apply the camera settings to the currently active cadwork document.
from_activedoc
classmethod
¤
from_activedoc() -> Camera
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Create a camera from the camera in the currently active cadwork document.
Returns:
-
Camera–The camera object created from the active cadwork document.
look_at
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Set the camera to look at a specific target point.
Raises:
-
ValueError–If the up vector and the camera-to-target vector are not orthogonal.
Parameters:
reload_camera
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Load the camera settings from the currently active cadwork document.
reset_view
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Reset the camera to the standard axonometric view.
zoom_active_element
¤
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Zoom the camera to the currently active element.
LinearDimensionSceneObject
deprecated
¤
Deprecated
Subject to removal, avoid using
Draw a linear dimension instruction.
Parameters:
-
linear_dimension(:class:`~monosashi.sequencer.LineraDimension`) –The linear dimension to draw.
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |
Text3dSceneObject
deprecated
¤
Deprecated
Subject to removal, avoid using
Draws a 3d text volume instruction onto the view.
Parameters:
-
text_instruction(:class:`~monosashi.sequencer.Text3d`) –The text instruction to draw.
| Software compatibility: | ||
|---|---|---|
| ✅ Cadwork 2024 | ✅ Cadwork 2025 | ✅ Cadwork 2026 |