Geometry Module¶
This module provides classes and functions for creating and manipulating geometric shapes in a 3D space. The shapes include boxes, spheres, cylinders, cones, and pyramids. Each shape can be defined by its dimensions, color, and position in space.
Classes:¶
geometry_obj: A class representing a geometric shape with methods for manipulation and retrieval of properties.
Functions:¶
gbox: Creates a box geometry with specified dimensions and color.
gsphere: Creates a sphere geometry with specified radius, slices, stacks, and color.
gcylinder: Creates a cylinder geometry with specified radius, top and bottom center positions, number of slices, and color.
gcone: Creates a cone geometry with specified height, radius, number of slices, and color.
gpyramid: Creates a pyramid geometry with specified dimensions, center positions, and color.
- escape.scattering.geometry.gbox(wx: ParameterLike = 2, wy: ParameterLike = 2, wz: ParameterLike = 2, position: object = None, yaw: ParameterLike = 0.0, pitch: ParameterLike = 0.0, roll: ParameterLike = 0.0, color: str = 'FFFFFF', name: str = 'Box', notes: str = '') geometry_obj¶
Creates a box geometry.
Parameters:¶
- wxParameterLike, optional
The width of the box along the x-axis (default is 2).
- wyParameterLike, optional
The width of the box along the y-axis (default is 2).
- wzParameterLike, optional
The width of the box along the z-axis (default is 2).
- colorstr, optional
The color of the box in hexadecimal format (default is “FFFFFF”).
- namestr, optional
The name of the box (default is “Box”).
- notesstr, optional
User notes for the object.
Returns:¶
- geometry_obj
A geometry_obj representing the box.
- escape.scattering.geometry.gsphere(radius: ParameterLike = 1, position: object = None, numslices: int = 16, numstacks: int = 8, color: str = 'FFFFFF', name: str = 'Sphere', notes: str = '') geometry_obj¶
Creates a sphere geometry.
Parameters:¶
- radiusParameterLike, optional
The radius of the sphere (default is 1).
- numslicesint, optional
The number of slices for the sphere (default is 16).
- numstacksint, optional
The number of stacks for the sphere (default is 8).
- colorstr, optional
The color of the sphere in hexadecimal format (default is “FFFFFF”).
- namestr, optional
The name of the sphere (default is “Sphere”).
- notesstr, optional
User notes for the object.
Returns:¶
- geometry_obj
A geometry_obj representing the sphere.
- escape.scattering.geometry.gcylinder(radius: ParameterLike = 1, height: ParameterLike = 1, position: object = None, yaw: ParameterLike = 0.0, pitch: ParameterLike = 0.0, roll: ParameterLike = 0.0, numslices: int = 16, color: str = 'FFFFFF', name: str = 'Cylinder', notes: str = '') geometry_obj¶
Creates a cylinder geometry.
Parameters:¶
- radiusParameterLike, optional
The radius of the cylinder (default is 1).
- heightParameterLike, optional
Full cylinder height along local +Z (default is 1).
- positionobject, optional
Geometry center position as [x, y, z] (default is origin).
- yaw, pitch, rollParameterLike, optional
Euler angles in degrees (default is 0 for each).
- numslicesint, optional
The number of slices for the cylinder (default is 16).
- colorstr, optional
The color of the cylinder in hexadecimal format (default is “FFFFFF”).
- namestr, optional
The name of the cylinder (default is “Cylinder”).
- notesstr, optional
User notes for the object.
Returns:¶
- geometry_obj
A geometry_obj representing the cylinder.
- escape.scattering.geometry.gcone(height: ParameterLike = 1, radius: ParameterLike = 1, position: object = None, yaw: ParameterLike = 0.0, pitch: ParameterLike = 0.0, roll: ParameterLike = 0.0, numslices: int = 16, color: str = 'FFFFFF', name: str = 'Cone', notes: str = '') geometry_obj¶
Creates a cone geometry.
Parameters:¶
- heightParameterLike, optional
The height of the cone (default is 1).
- radiusParameterLike, optional
The radius of the cone (default is 1).
- numslicesint, optional
The number of slices for the cone (default is 16).
- colorstr, optional
The color of the cone in hexadecimal format (default is “FFFFFF”).
- namestr, optional
The name of the cone (default is “Cone”).
- notesstr, optional
User notes for the object.
Returns:¶
- geometry_obj
A geometry_obj representing the cone.
- escape.scattering.geometry.gpyramid(wx_bot: ParameterLike = 1, wy_bot: ParameterLike = 1, wx_top: ParameterLike = 1, wy_top: ParameterLike = 1, height: ParameterLike = 1, position: object = None, yaw: ParameterLike = 0.0, pitch: ParameterLike = 0.0, roll: ParameterLike = 0.0, color: str = 'FFFFFF', name: str = 'Pyramid', notes: str = '') geometry_obj¶
Creates a pyramid geometry.
Parameters:¶
- wx_botParameterLike, optional
The width of the pyramid at the bottom (default is 1).
- wy_botParameterLike, optional
The height of the pyramid at the bottom (default is 1).
- wx_topParameterLike, optional
The width of the pyramid at the top (default is 1).
- wy_topParameterLike, optional
The height of the pyramid at the top (default is 1).
- heightParameterLike, optional
Full pyramid height along local +Z (default is 1).
- positionobject, optional
Geometry center position as [x, y, z] (default is origin).
- yaw, pitch, rollParameterLike, optional
Euler angles in degrees (default is 0 for each).
- colorstr, optional
The color of the pyramid in hexadecimal format (default is “FFFFFF”).
- namestr, optional
The name of the pyramid (default is “Pyramid”).
- notesstr, optional
User notes for the object.
Returns:¶
- geometry_obj
A geometry_obj representing the pyramid.