compas_notebook.conversions
¤
Functions¤
box_to_threejs
¤
box_to_threejs(box: Box) -> BoxGeometry
Convert a COMPAS box to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
box
|
Box
|
The box to convert. |
required |
Returns:
| Type | Description |
|---|---|
BoxGeometry
|
|
Examples:
color_to_threejs
¤
color_to_threejs(color: Color) -> MeshBasicMaterial
Convert a COMPAS color to a PyThreeJS material.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
Color
|
The color to convert. |
required |
Returns:
| Type | Description |
|---|---|
MeshBasicMaterials
|
The PyThreeJS material. |
Examples:
cone_to_threejs
¤
cone_to_threejs(cone: Cone) -> CylinderGeometry
Convert a COMPAS cone to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cone
|
Cone
|
The cone to convert. |
required |
Returns:
| Type | Description |
|---|---|
CylinderGeometry
|
|
Examples:
cylinder_to_threejs
¤
cylinder_to_threejs(cylinder: Cylinder) -> CylinderGeometry
Convert a COMPAS cylinder to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cylinder
|
Cylinder
|
The cylinder to convert. |
required |
Returns:
| Type | Description |
|---|---|
CylinderGeometry
|
|
Examples:
dot_to_threejs
¤
Convert a COMPAS Dot to PyThreeJS Sprite.
The sprite maintains constant screen size regardless of zoom level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dot
|
Dot
|
The dot to convert. |
required |
fontsize
|
int
|
Font size for the text texture. |
48
|
color
|
str
|
Text color. |
'white'
|
Returns:
| Type | Description |
|---|---|
Sprite
|
A sprite with text texture positioned at the dot location. |
line_to_threejs
¤
line_to_threejs(line: Line) -> BufferGeometry
Convert a COMPAS line to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
line
|
Line
|
The line to convert. |
required |
Returns:
| Type | Description |
|---|---|
BufferGeometry
|
|
nodes_and_edges_to_threejs
¤
nodes_to_threejs
¤
point_to_threejs
¤
point_to_threejs(point: Point) -> SphereGeometry
Convert a COMPAS point to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Point
|
The point to convert. |
required |
Returns:
| Type | Description |
|---|---|
BufferGeometry
|
|
Examples:
pointcloud_to_threejs
¤
pointcloud_to_threejs(pointcloud: Pointcloud) -> SphereGeometry
Convert a COMPAS point to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pointcloud
|
Pointcloud
|
The pointcloud to convert. |
required |
Returns:
| Type | Description |
|---|---|
BufferGeometry
|
|
Examples:
polyline_to_threejs
¤
polyline_to_threejs(polyline: Polyline) -> BufferGeometry
Convert a COMPAS polyline to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
polyline
|
Polyline
|
The polyline to convert. |
required |
Returns:
| Type | Description |
|---|---|
BufferGeometry
|
|
shapes_to_edgesbuffer
¤
shapes_to_facesbuffer
¤
sphere_to_threejs
¤
sphere_to_threejs(sphere: Sphere) -> SphereGeometry
Convert a COMPAS sphere to PyThreeJS.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sphere
|
Sphere
|
The sphere to convert. |
required |
Returns:
| Type | Description |
|---|---|
SphereGeometry
|
|
Examples:
torus_to_threejs
¤
torus_to_threejs(torus: Torus) -> TorusGeometry
Convert a COMPAS torus to a PyThreeJS torus geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
torus
|
Torus
|
The torus to convert. |
required |
Returns:
| Type | Description |
|---|---|
TorusGeometry
|
The PyThreeJS torus geometry. |
Examples: