# Volumes ```{eval-rst} .. py:function:: createBox(FirstPoint, SecondPoint) :nocontentsentry: Box (P,P): Create a box defined by two opposite vertices | Alias: box | Constraints: 3 dimensions, Referenced :param Entity FirstPoint: Point1: First corner of the box. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. :param Entity SecondPoint: Point2: Second corner of the box . Conditions: "" does not exist in the dropdown list. The input must be non-empty. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(FirstPoint, SecondPoint) :nocontentsentry: Box (P,P): Create a box defined by two opposite vertices | Alias: box | Constraints: 3 dimensions, Not referenced :param Point FirstPoint: Point1: First corner of the box. Conditions: Points can not match. :param Point SecondPoint: Point2: Second corner of the box . :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(GeomName, FirstPoint, SecondPoint) :nocontentsentry: Box (P,P): Create a box defined by two opposite vertices | Alias: box | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Entity FirstPoint: Point1: First corner of the box. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. :param Entity SecondPoint: Point2: Second corner of the box . Conditions: "" does not exist in the dropdown list. The input must be non-empty. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(GeomName, FirstPoint, SecondPoint) :nocontentsentry: Box (P,P): Create a box defined by two opposite vertices | Alias: box | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point FirstPoint: Point1: First corner of the box. Conditions: Points can not match. :param Point SecondPoint: Point2: Second corner of the box . :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(FirstPoint, DX, DY, DZ) :nocontentsentry: Box (P,Dim): Create a box defined by a vertex and its dimensions | Alias: box | Constraints: 3 dimensions, Referenced :param POCCVertexByCoord FirstPoint: Point1: First corner of the box. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double DX: DX: Box dimension along the X coordinate. Conditions: Value must be greater than 0. :param Double DY: DY: Box dimension along the Y coordinate. Conditions: Value must be greater than 0. :param Double DZ: DZ: Box dimension along the Z coordinate. Conditions: Value must be greater than 0. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(FirstPoint, DX, DY, DZ) :nocontentsentry: Box (P,Dim): Create a box defined by a vertex and its dimensions | Alias: box | Constraints: 3 dimensions, Not referenced :param Point FirstPoint: Point1: First corner of the box. :param Double DX: DX: Box dimension along the X coordinate. Conditions: Value must be greater than 0. :param Double DY: DY: Box dimension along the Y coordinate. Conditions: Value must be greater than 0. :param Double DZ: DZ: Box dimension along the Z coordinate. Conditions: Value must be greater than 0. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(GeomName, FirstPoint, DX, DY, DZ) :nocontentsentry: Box (P,Dim): Create a box defined by a vertex and its dimensions | Alias: box | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCVertexByCoord FirstPoint: Point1: First corner of the box. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double DX: DX: Box dimension along the X coordinate. Conditions: Value must be greater than 0. :param Double DY: DY: Box dimension along the Y coordinate. Conditions: Value must be greater than 0. :param Double DZ: DZ: Box dimension along the Z coordinate. Conditions: Value must be greater than 0. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createBox(GeomName, FirstPoint, DX, DY, DZ) :nocontentsentry: Box (P,Dim): Create a box defined by a vertex and its dimensions | Alias: box | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point FirstPoint: Point1: First corner of the box. :param Double DX: DX: Box dimension along the X coordinate. Conditions: Value must be greater than 0. :param Double DY: DY: Box dimension along the Y coordinate. Conditions: Value must be greater than 0. :param Double DZ: DZ: Box dimension along the Z coordinate. Conditions: Value must be greater than 0. :rtype: Return a GeomVolume ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a box (volume) using a reference point and dimensions # --- Non-referenced mode --- # In this mode, the box is created directly from coordinate values and dimensions, # without referencing any existing geometric entities. first_point = Point(0, 0, 0) # Corner point of the box (reference point) dx = Double(1) # Box length along the X direction dy = Double(1) # Box width along the Y direction dz = Double(1) # Box height along the Z direction box_geom_entity = createBox( "Volume", # Name of the resulting box entity first_point, # Reference point for the corner dx, # Dimension along X dy, # Dimension along Y dz # Dimension along Z ) # --- Referenced mode --- # In this mode, the box is created using an existing point entity as reference, # allowing parametric relationships within the model. first_point_geom_entity = createPoint("Point", Point(2, 0, 0)) # Create a point entity for the box corner box_geom_entity = createBox( "Volume (2)", # Name of the resulting box entity first_point_geom_entity, # Reference to the point entity dx, dy, dz # Box dimensions along X, Y, and Z ) ``` ```{eval-rst} .. py:function:: createCone(Center, Axis, BaseRadius, TopRadius, Height, Angle) :nocontentsentry: Cone: Create a cone | Alias: cone | Constraints: 3 dimensions, Referenced :param POCCVertexByCoord Center: Center: Central point of the cone base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param POCCGeomLine Axis: Axis: Cone axis. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double BaseRadius: Radius: Radius of the lower base. Conditions: Value must be greater than 0. :param Double TopRadius: Upper radius: Radius of the upper base. Conditions: Value must be greater or equal than 0. :param Double Height: Height: Height of the cone. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cone. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCone(Center, Axis, BaseRadius, TopRadius, Height, Angle) :nocontentsentry: Cone: Create a cone | Alias: cone | Constraints: 3 dimensions, Not referenced :param Point Center: Center: Central point of the cone base. :param Vector Axis: Axis: Cone axis. Conditions: A vector cannot have zero magnitude. :param Double BaseRadius: Radius: Radius of the lower base. Conditions: Value must be greater than 0. :param Double TopRadius: Upper radius: Radius of the upper base. Conditions: Value must be greater or equal than 0. :param Double Height: Height: Height of the cone. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cone. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCone(GeomName, Center, Axis, BaseRadius, TopRadius, Height, Angle) :nocontentsentry: Cone: Create a cone | Alias: cone | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCVertexByCoord Center: Center: Central point of the cone base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param POCCGeomLine Axis: Axis: Cone axis. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double BaseRadius: Radius: Radius of the lower base. Conditions: Value must be greater than 0. :param Double TopRadius: Upper radius: Radius of the upper base. Conditions: Value must be greater or equal than 0. :param Double Height: Height: Height of the cone. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cone. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCone(GeomName, Center, Axis, BaseRadius, TopRadius, Height, Angle) :nocontentsentry: Cone: Create a cone | Alias: cone | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point Center: Center: Central point of the cone base. :param Vector Axis: Axis: Cone axis. Conditions: A vector cannot have zero magnitude. :param Double BaseRadius: Radius: Radius of the lower base. Conditions: Value must be greater than 0. :param Double TopRadius: Upper radius: Radius of the upper base. Conditions: Value must be greater or equal than 0. :param Double Height: Height: Height of the cone. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cone. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a cone using a Python command # Geometric parameters of the cone base_radius = Double(1) # Base radius of the cone top_radius = Double(0) # Top radius (0 means the cone ends in a vertex) height = Double(1) # Total height of the cone angle = Double(360) # Revolution angle (360° creates a full cone) # --- Non-referenced mode --- # In this mode, the cone is defined directly from coordinates and vectors, # without using any existing geometric entities. center = Point(0, 0, 0) # Center of the cone base axis = Vector(0, 0, 1) # Axis direction (along the Z axis) cone_geom_entity = createCone( "Not referenced user cone", # Name of the resulting cone entity center, # Center point of the base axis, # Axis direction base_radius, # Base radius top_radius, # Top radius height, # Height angle # Opening angle ) # --- Referenced mode --- # In this mode, the cone is created based on existing geometric entities (points, axes, etc.). # This approach allows the cone to remain parametrically linked to other elements in the model. center_geom_entity = createPoint("Point", center) # Create a point entity axis_geom_entity = createAxis("Curve", Point(0, 0, 0), axis) # Create an axis entity cone_geom_entity = createCone( "Referenced user cone", # Name of the resulting cone entity center_geom_entity, # Reference to the center point entity axis_geom_entity, # Reference to the axis entity base_radius, # Base radius top_radius, # Top radius height, # Height angle # Opening angle ) ``` ```{eval-rst} .. py:function:: createCylinder(Pnt1, Pnt2, Pnt3) :nocontentsentry: Cylinder (C,C,P): Create a hollow cylinder defined by the centers of its bases and a point on its lateral surface | Alias: cylinder | Constraints: 3 dimensions, Referenced :param Entity Pnt1: Point1: Central point of the lower base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. Points can not be collinear. :param Entity Pnt2: Point2: Central point of the upper base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. :param Entity Pnt3: Point3: Point on the surface of the cylinder. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(Pnt1, Pnt2, Pnt3) :nocontentsentry: Cylinder (C,C,P): Create a hollow cylinder defined by the centers of its bases and a point on its lateral surface | Alias: cylinder | Constraints: 3 dimensions, Not referenced :param Point Pnt1: Point1: Central point of the lower base. Conditions: Points can not match. Points can not be collinear. :param Point Pnt2: Point2: Central point of the upper base. Conditions: Points can not match. :param Point Pnt3: Point3: Point on the surface of the cylinder. Conditions: Points can not match. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(GeomName, Pnt1, Pnt2, Pnt3) :nocontentsentry: Cylinder (C,C,P): Create a hollow cylinder defined by the centers of its bases and a point on its lateral surface | Alias: cylinder | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Entity Pnt1: Point1: Central point of the lower base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. Points can not be collinear. :param Entity Pnt2: Point2: Central point of the upper base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. :param Entity Pnt3: Point3: Point on the surface of the cylinder. Conditions: "" does not exist in the dropdown list. The input must be non-empty. Points can not match. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(GeomName, Pnt1, Pnt2, Pnt3) :nocontentsentry: Cylinder (C,C,P): Create a hollow cylinder defined by the centers of its bases and a point on its lateral surface | Alias: cylinder | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point Pnt1: Point1: Central point of the lower base. Conditions: Points can not match. Points can not be collinear. :param Point Pnt2: Point2: Central point of the upper base. Conditions: Points can not match. :param Point Pnt3: Point3: Point on the surface of the cylinder. Conditions: Points can not match. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(Center, Axis, Radius, Height, Angle) :nocontentsentry: Cylinder: Create a cylinder | Alias: cylinder | Constraints: 3 dimensions, Referenced :param POCCVertexByCoord Center: Center: Central point of the base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param POCCGeomLine Axis: Axis: Axis of the cylinder. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double Radius: Radius: Radius of the cylinder. Conditions: Value must be greater than 0. :param Double Height: Height: Height of the cylinder. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cylinder. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(Center, Axis, Radius, Height, Angle) :nocontentsentry: Cylinder: Create a cylinder | Alias: cylinder | Constraints: 3 dimensions, Not referenced :param Point Center: Center: Central point of the base. :param Vector Axis: Axis: Axis of the cylinder. Conditions: A vector cannot have zero magnitude. :param Double Radius: Radius: Radius of the cylinder. Conditions: Value must be greater than 0. :param Double Height: Height: Height of the cylinder. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cylinder. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(GeomName, Center, Axis, Radius, Height, Angle) :nocontentsentry: Cylinder: Create a cylinder | Alias: cylinder | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCVertexByCoord Center: Center: Central point of the base. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param POCCGeomLine Axis: Axis: Axis of the cylinder. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double Radius: Radius: Radius of the cylinder. Conditions: Value must be greater than 0. :param Double Height: Height: Height of the cylinder. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cylinder. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createCylinder(GeomName, Center, Axis, Radius, Height, Angle) :nocontentsentry: Cylinder: Create a cylinder | Alias: cylinder | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point Center: Center: Central point of the base. :param Vector Axis: Axis: Axis of the cylinder. Conditions: A vector cannot have zero magnitude. :param Double Radius: Radius: Radius of the cylinder. Conditions: Value must be greater than 0. :param Double Height: Height: Height of the cylinder. Conditions: Value must be greater than 0. :param Double Angle: Angle: Angle to truncate the cylinder. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a cylinder using three points # This command creates a cylindrical surface or volume defined by: # - A point at the center of the lower base # - A point at the center of the top base # - A point located on the cylinder surface (used to determine the radius) # # The cylinder is automatically computed so that its axis passes through # the two base-center points, and its radius is defined by the surface point. # --- Non-referenced mode --- center_lower_base = Point(0, 0, 0) # Center point of the lower base center_top_base = Point(0, 0, 1) # Center point of the top base point_on_surface = Point(0, 1, 0.5) # Point lying on the cylinder surface cylinder_geom_entity = createCylinder( "Surfaces group", # Name of the resulting cylinder entity center_lower_base, # Base center point center_top_base, # Top center point point_on_surface # Point defining the cylinder radius ) # --- Referenced mode --- center_lower_base_geom_entity = createPoint("Point", Point(0, 0, 0)) # Referenced lower base center center_top_base_geom_entity = createPoint("Point (2)", Point(0, 0, 1)) # Referenced top base center point_on_surface_geom_entity = createPoint("Point (3)", Point(0, 1, 0.5)) # Referenced surface point cylinder_geom_entity = createCylinder( "Surfaces group (2)", # Name of the resulting cylinder entity center_lower_base_geom_entity, # Referenced base center center_top_base_geom_entity, # Referenced top center point_on_surface_geom_entity # Referenced surface point ) ``` ```{eval-rst} .. py:function:: createSphere(Center, Radius, Angle, Angle1) :nocontentsentry: Sphere: Create a sphere | Alias: sphere | Constraints: 3 dimensions, Referenced :param POCCVertexByCoord Center: Central point: Central point of the sphere. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double Radius: Radius: Radius of the sphere. Conditions: Value must be greater than 0. :param Double Angle: Ang: Angle in the U parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :param Double Angle1: Ang1: Angle in the V parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 3.14. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createSphere(Center, Radius, Angle, Angle1) :nocontentsentry: Sphere: Create a sphere | Alias: sphere | Constraints: 3 dimensions, Not referenced :param Point Center: Central point: Central point of the sphere. :param Double Radius: Radius: Radius of the sphere. Conditions: Value must be greater than 0. :param Double Angle: Ang: Angle in the U parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :param Double Angle1: Ang1: Angle in the V parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 3.14. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createSphere(GeomName, Center, Radius, Angle, Angle1) :nocontentsentry: Sphere: Create a sphere | Alias: sphere | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCVertexByCoord Center: Central point: Central point of the sphere. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double Radius: Radius: Radius of the sphere. Conditions: Value must be greater than 0. :param Double Angle: Ang: Angle in the U parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :param Double Angle1: Ang1: Angle in the V parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 3.14. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createSphere(GeomName, Center, Radius, Angle, Angle1) :nocontentsentry: Sphere: Create a sphere | Alias: sphere | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point Center: Central point: Central point of the sphere. :param Double Radius: Radius: Radius of the sphere. Conditions: Value must be greater than 0. :param Double Angle: Ang: Angle in the U parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :param Double Angle1: Ang1: Angle in the V parametric direction. Conditions: Value must be greater or equal than 0.00 and lower than 3.14. :rtype: Return a GeomVolume ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a sphere with specified center, radius, and angular spans # This command creates a sphere (or a portion of a sphere) based on a given center, # radius, and angles along U and V directions. The U and V angles define the # portion of the sphere to be created. The command supports both non-referenced # and referenced modes. # --- Non-referenced mode --- # Define the sphere's center center = Point(0, 0, 0) # Define the radius radius = Double(1) # Define angular spans in degrees ang_u_dir = Double(360) # U direction (longitude) ang_v_dir = Double(180) # V direction (latitude) # Create the sphere directly from coordinates sphere_geom_entity = createSphere( "Volume", # Name of the resulting sphere center, radius, ang_u_dir, ang_v_dir ) # --- Referenced mode --- # Create a point entity to use as the sphere's center center_point_geom_entity = createPoint("Point", Point(0, 0, 0)) # Create the sphere using a referenced center sphere_geom_entity = createSphere( "Volume (2)", # Name of the resulting sphere center_point_geom_entity, radius, ang_u_dir, ang_v_dir ) # Result: # A sphere or partial sphere is created with the specified center, radius, # and angular spans. In referenced mode, the center point is linked to the # sphere entity. ``` ```{eval-rst} .. py:function:: createTorus(Center, Axis, MinRadius, MajRadius, Angle) :nocontentsentry: Torus: Create a torus | Alias: torus | Constraints: 3 dimensions, Referenced :param POCCVertexByCoord Center: Center: Central point of the torus. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param POCCGeomLine Axis: Axis: Axis of the torus. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double MinRadius: Minor radius: Minor radius of the torus. Conditions: Value must be greater than 0. :param Double MajRadius: Major radius: Major radius of the torus. Conditions: Value must be greater than 0. Major and minor radius can't be inverted. :param Double Angle: Angle: Angle to build a portion of a torus. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createTorus(Center, Axis, MinRadius, MajRadius, Angle) :nocontentsentry: Torus: Create a torus | Alias: torus | Constraints: 3 dimensions, Not referenced :param Point Center: Center: Central point of the torus. :param Vector Axis: Axis: Axis of the torus. Conditions: A vector cannot have zero magnitude. :param Double MinRadius: Minor radius: Minor radius of the torus. Conditions: Value must be greater than 0. :param Double MajRadius: Major radius: Major radius of the torus. Conditions: Value must be greater than 0. Major and minor radius can't be inverted. :param Double Angle: Angle: Angle to build a portion of a torus. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createTorus(GeomName, Center, Axis, MinRadius, MajRadius, Angle) :nocontentsentry: Torus: Create a torus | Alias: torus | Constraints: 3 dimensions, Referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCVertexByCoord Center: Center: Central point of the torus. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param POCCGeomLine Axis: Axis: Axis of the torus. Conditions: "" does not exist in the dropdown list. The input must be non-empty. :param Double MinRadius: Minor radius: Minor radius of the torus. Conditions: Value must be greater than 0. :param Double MajRadius: Major radius: Major radius of the torus. Conditions: Value must be greater than 0. Major and minor radius can't be inverted. :param Double Angle: Angle: Angle to build a portion of a torus. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: createTorus(GeomName, Center, Axis, MinRadius, MajRadius, Angle) :nocontentsentry: Torus: Create a torus | Alias: torus | Constraints: 3 dimensions, Not referenced :param str GeomName: Name. Conditions: "" input must be non-empty. :param Point Center: Center: Central point of the torus. :param Vector Axis: Axis: Axis of the torus. Conditions: A vector cannot have zero magnitude. :param Double MinRadius: Minor radius: Minor radius of the torus. Conditions: Value must be greater than 0. :param Double MajRadius: Major radius: Major radius of the torus. Conditions: Value must be greater than 0. Major and minor radius can't be inverted. :param Double Angle: Angle: Angle to build a portion of a torus. Conditions: Value must be greater or equal than 0.00 and lower than 6.28. :rtype: Return a GeomVolume ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a torus (donut-shaped volume) with specified center, direction, radii, and angular span # This command creates a torus, which is a donut-shaped 3D volume. # The torus is defined by a center point, a direction vector (axis), a minor radius # (tube radius), a major radius (distance from the center to the tube center), # and an angle to define the portion of the torus to create. # The command supports both non-referenced and referenced modes. # --- Non-referenced mode --- # Define the torus center center = Point(0, 0, 0) # Define the torus axis direction direction = Vector(0, 0, 1) # Define the radii minor_radius = Double(0.5) # Radius of the tube major_radius = Double(1) # Radius from center to tube center # Define the angular portion of the torus (360 for a full torus) angle_of_torus = Double(360) # Create the torus directly from coordinates volume_geom_entity = createTorus( "Volume", # Name of the resulting torus center, direction, minor_radius, major_radius, angle_of_torus ) # --- Referenced mode --- # Create a point entity for the torus center center_point_geom_entity = createPoint("Point", Point(0, 0, 0)) # Create an axis entity for the torus direction direction_geom_entity = createAxis("Curve", Point(0, 0, 0), Vector(1, 0, 0)) # Create the torus using referenced entities volume_geom_entity = createTorus( "Volume (2)", # Name of the resulting torus center_point_geom_entity, direction_geom_entity, minor_radius, major_radius, angle_of_torus ) # Result: # A torus or a partial torus is created with the specified parameters. # In referenced mode, the center and axis are linked to the torus entity. ``` ```{eval-rst} .. py:function:: geomVolumeFaces(Surfaces) :nocontentsentry: Fill: Create a volume filling the space between a closed surfaces set | Alias: volumeFaces | Constraints: 3 dimensions :param List Surfaces: Surfaces: List of surfaces. Conditions: "" does not exist in the dropdown list. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: geomVolumeFaces(GeomName, Surfaces) :nocontentsentry: Fill: Create a volume filling the space between a closed surfaces set | Alias: volumeFaces | Constraints: 3 dimensions :param str GeomName: Name. Conditions: "" input must be non-empty. :param List Surfaces: Surfaces: List of surfaces. Conditions: "" does not exist in the dropdown list. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: geomVolumePoints(ListPnts) :nocontentsentry: By points: Create a volume defined by its vertices | Alias: volumePoints | Constraints: 3 dimensions :param List ListPnts: Points: List of points to create the volume. :rtype: Return a GeomVolume ``` ```{eval-rst} .. py:function:: geomVolumePoints(GeomName, ListPnts) :nocontentsentry: By points: Create a volume defined by its vertices | Alias: volumePoints | Constraints: 3 dimensions :param str GeomName: Name. Conditions: "" input must be non-empty. :param List ListPnts: Points: List of points to create the volume. :rtype: Return a GeomVolume ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a volume from a set of points # Step 1: Create a reference box to extract points from box_volume = createBox("Volume", Point(0, 0, 0), Double(1), Double(1), Double(1)) # Step 2: Explode the box to get its vertices geomExplode([box_volume], "VERTEX") # Step 3: Assign the resulting vertices to variables geom1 = Geometry("Point") geom2 = Geometry("Point (7)") geom3 = Geometry("Point (5)") geom4 = Geometry("Point (1)") geom5 = Geometry("Point (2)") geom6 = Geometry("Point (6)") geom7 = Geometry("Point (4)") geom8 = Geometry("Point (3)") # Step 4: Create a new volume using the list of points # The points must form a closed shape to define a valid volume volume_geom_entity = geomVolumePoints( "Volume (2)", [geom8, geom7, geom6, geom5, geom4, geom3, geom2, geom1] ) # Result: # - A volume is created from the point cloud, replicating the original box shape # - The order of points is important to define the volume correctly ``` ```{eval-rst} .. py:function:: multiRotate(Axis, NumTimes, GeomObject) :nocontentsentry: Rotation: Create a group of volumes rotating an initial volume | Alias: multiRot | Constraints: 3 dimensions :param POCCGeomLine Axis: Axis: Axis of rotation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :param int NumTimes: Rotations: Number of times that the geometric entity will be rotated. :param POCCCylinder GeomObject: Geometric Entity: Geometric entity to be rotated. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :rtype: Return a GeomBody ``` ```{eval-rst} .. py:function:: multiRotate(GeomName, Axis, NumTimes, GeomObject) :nocontentsentry: Rotation: Create a group of volumes rotating an initial volume | Alias: multiRot | Constraints: 3 dimensions :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCGeomLine Axis: Axis: Axis of rotation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :param int NumTimes: Rotations: Number of times that the geometric entity will be rotated. :param POCCCylinder GeomObject: Geometric Entity: Geometric entity to be rotated. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :rtype: Return a GeomBody ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Rotating a geometry multiple times around an axis (without specifying an angle) # This command performs multiple rotations of a given geometry around # a defined axis. The rotation angle is implicitly determined by the # number of rotations, distributing them evenly around a full 360° turn. # Arguments: # 1. String: Name of the resulting geometric entity or group. # 2. Axis entity: Axis used as the center for the rotations. # 3. Integer: Number of rotations to perform (evenly spaced over 360°). # 4. Geometry entity: The geometry to be rotated. # Geometry to rotate box_geom_entity = createBox( "Volume", Point(0, 0, 0), Double(1), Double(1), Double(1) ) # Axis of rotation axis_geom_entity = createAxis("Curve", Point(0, 0, 0), Vector(1, 0, 0)) # Number of rotations to perform num_rotations = 1 # Execute the multi-rotation multiRotate( "Body", axis_geom_entity, num_rotations, box_geom_entity ) # Result: # A new geometric entity named "Body" is created by rotating the input # geometry multiple times around the specified axis. The copies are # evenly distributed along the full circular path. ``` ```{eval-rst} .. py:function:: multiRotTrans(Axis, Angle, NumTimes, Step, NumTimesDirV, GeomObject) :nocontentsentry: Translation & Rotation: Create a group of volumes translating and rotating an initial volume | Alias: multiRT | Constraints: 3 dimensions :param POCCGeomLine Axis: Axis: Axis of rotation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :param Double Angle: Angle: Angle of rotation. :param int NumTimes: Rotations: Number of times that the geometric entity will be rotated. Conditions: Value must be greater than 0. :param Double Step: Step: Step to multi-translate each rotation result. :param int NumTimesDirV: Translations: Number of times to be translated. Conditions: Value must be greater than 0. :param POCCCylinder GeomObject: Geometric Entity: Geometric entity to be rotated. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :rtype: Return a GeomBody ``` ```{eval-rst} .. py:function:: multiRotTrans(GeomName, Axis, Angle, NumTimes, Step, NumTimesDirV, GeomObject) :nocontentsentry: Translation & Rotation: Create a group of volumes translating and rotating an initial volume | Alias: multiRT | Constraints: 3 dimensions :param str GeomName: Name. Conditions: "" input must be non-empty. :param POCCGeomLine Axis: Axis: Axis of rotation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :param Double Angle: Angle: Angle of rotation. :param int NumTimes: Rotations: Number of times that the geometric entity will be rotated. Conditions: Value must be greater than 0. :param Double Step: Step: Step to multi-translate each rotation result. :param int NumTimesDirV: Translations: Number of times to be translated. Conditions: Value must be greater than 0. :param POCCCylinder GeomObject: Geometric Entity: Geometric entity to be rotated. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :rtype: Return a GeomBody ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Applying multiple rotations and translations to a geometry # This command combines multiple rotations and translations applied # sequentially to a given geometry. It can be used to generate # complex patterns or repeated geometries arranged in both rotational # and linear sequences. # Arguments: # 1. String: Name of the resulting geometric entity or group. # 2. Axis entity: Axis used as the center for the rotations and reference for translations. # 3. Double: Rotation angle per step (in degrees). # 4. Integer: Number of rotations to perform. # 5. Double: Translation length per step. # 6. Integer: Number of translations to perform. # 7. Geometry entity: The geometry to which the transformations are applied. # Geometry to transform box_geom_entity = createBox( "Volume", Point(0, 0, 0), Double(1), Double(1), Double(1) ) # Axis of rotation and translation axis_geom_entity = createAxis("Curve", Point(0, 0, 0), Vector(1, 0, 0)) # Transformation parameters num_rotations = 1 rot_angle = Double(180) # Rotation angle per step (in degrees) num_translations = 1 translation_length = Double(1) # Translation distance per step # Execute the combined multi-rotation and translation multiRotTrans( "Body", axis_geom_entity, rot_angle, num_rotations, translation_length, num_translations, box_geom_entity ) # Result: # A new geometric entity named "Body" is created by applying the specified # number of rotations and translations to the input geometry. # The final result is a pattern combining both circular and linear repetitions. ``` ```{eval-rst} .. py:function:: multiTranslation(DirU, StepDirU, NumTimesDirU, DirV, StepDirV, NumTimesDirV, GeomObject) :nocontentsentry: Translation: Create a group of volumes translating an initial volume | Alias: multiTrans | Constraints: 3 dimensions :param Entity DirU: Vector 1: First vector to define the translation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :param Double StepDirU: Step 1: Translation step for the first translation vector. Conditions: Value must be greater than 0. :param int NumTimesDirU: Number 1: Number of translations to be done along the first direction. Conditions: Value must be greater than 0. :param Entity DirV: Vector 2: Second vector to define the translation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. Curves can not be coincidents. :param Double StepDirV: Step 2: Translation step for the second translation vector. Conditions: Value must be greater than 0. :param int NumTimesDirV: Number 2: Number of translations to be done along the second direction. Conditions: Value must be greater or equal than 0. :param POCCCylinder GeomObject: Geometric entity: Geometric entity to be translated. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :rtype: Return a GeomBody ``` ```{eval-rst} .. py:function:: multiTranslation(GeomName, DirU, StepDirU, NumTimesDirU, DirV, StepDirV, NumTimesDirV, GeomObject) :nocontentsentry: Translation: Create a group of volumes translating an initial volume | Alias: multiTrans | Constraints: 3 dimensions :param str GeomName: Name. Conditions: "" input must be non-empty. :param Entity DirU: Vector 1: First vector to define the translation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :param Double StepDirU: Step 1: Translation step for the first translation vector. Conditions: Value must be greater than 0. :param int NumTimesDirU: Number 1: Number of translations to be done along the first direction. Conditions: Value must be greater than 0. :param Entity DirV: Vector 2: Second vector to define the translation. Conditions: The input must be non-empty. "" does not exist in the dropdown list. Curves can not be coincidents. :param Double StepDirV: Step 2: Translation step for the second translation vector. Conditions: Value must be greater than 0. :param int NumTimesDirV: Number 2: Number of translations to be done along the second direction. Conditions: Value must be greater or equal than 0. :param POCCCylinder GeomObject: Geometric entity: Geometric entity to be translated. Conditions: The input must be non-empty. "" does not exist in the dropdown list. :rtype: Return a GeomBody ``` *Example:* ```{code-block} python # -*- coding: utf-8 -*- # Example: Creating a 2D grid of translated copies of a geometry # This command performs multiple translations of a given geometry # along two independent directions, effectively creating a grid or # matrix of replicated entities. It is useful for generating arrays # of repeated elements in both X and Y directions. # Arguments: # 1. String: Name of the resulting geometric entity or group. # 2. Axis entity: First direction axis for translation. # 3. Double: Translation distance along the first direction. # 4. Integer: Number of translations along the first direction. # 5. Axis entity: Second direction axis for translation. # 6. Double: Translation distance along the second direction. # 7. Integer: Number of translations along the second direction. # 8. Geometry entity: The geometry to be translated. # Geometry to translate box_geom_entity = createBox( "Volume", Point(0, 0, 0), Double(1), Double(1), Double(1) ) # Axes defining the translation directions axis_dir1_geom_entity = createAxis("Curve", Point(0, 0, 0), Vector(1, 0, 0)) # X-direction axis_dir2_geom_entity = createAxis("Curve (2)", Point(0, 0, 0), Vector(0, 1, 0)) # Y-direction # Translation parameters num_translations_dir1 = 1 # Number of translations along X num_translations_dir2 = 1 # Number of translations along Y translation_length_dir1 = Double(1) # Distance between copies in X translation_length_dir2 = Double(1) # Distance between copies in Y # Execute the multiple translations to create a grid of copies multiTranslation( "Body", axis_dir1_geom_entity, translation_length_dir1, num_translations_dir1, axis_dir2_geom_entity, translation_length_dir2, num_translations_dir2, box_geom_entity ) # Result: # A new geometric entity named "Body" is created as a 2D grid of the # original geometry, replicated along the two specified directions. ```