API Documentation¶
Class Reference¶
Analytic Geometry¶
-
class
geomdl.shapes.analytic.
Circle
(**kwargs)¶ Bases:
geomdl.shapes.analytic.AnalyticGeometry
Analytic circle geometry
Finds the points on a circle using the following equation:
- Keyword Arguments:
radius
: radius of the circle. Default: 1origin
: coordinates of the circle center. Default: (0, 0)
-
data
¶ Returns a dict which contains the geometry data.
Please refer to the wiki for details on using this class member.
-
dimension
¶ Spatial dimension.
Please refer to the wiki for details on using this class member.
Getter: Gets the spatial dimension, e.g. 2D, 3D, etc. Type: int
-
evalpts
¶ Evaluated points.
Please refer to the wiki for details on using this class member.
Getter: Gets the coordinates of the evaluated points Type: list
-
evaluate
(**kwargs)¶ Evaluates the circle.
- Keyword Arguments:
start
: start angle in degrees. Default: 0stop
: stop angle in degrees. Default: 360jump
: angle increment in degrees. Default: 0.5
-
id
¶ Object ID (as an integer).
Please refer to the wiki for details on using this class member.
Getter: Gets the object ID Setter: Sets the object ID Type: int
-
name
¶ Object name (as a string)
Please refer to the wiki for details on using this class member.
Getter: Gets the object name Setter: Sets the object name Type: str
-
opt
¶ Dictionary for storing custom data in the current geometry object.
opt
is a wrapper to a dict in key => value format, where key is string, value is any Python object. You can useopt
property to store custom data inside the geometry object. For instance:geom.opt = ["face_id", 4] # creates "face_id" key and sets its value to an integer geom.opt = ["contents", "data values"] # creates "face_id" key and sets its value to a string print(geom.opt) # will print: {'face_id': 4, 'contents': 'data values'} del geom.opt # deletes the contents of the hash map print(geom.opt) # will print: {} geom.opt = ["body_id", 1] # creates "body_id" key and sets its value to 1 geom.opt = ["body_id", 12] # changes the value of "body_id" to 12 print(geom.opt) # will print: {'body_id': 12} geom.opt = ["body_id", None] # deletes "body_id" print(geom.opt) # will print: {}
Please refer to the wiki for details on using this class member.
Getter: Gets the dict Setter: Adds key and value pair to the dict Deleter: Deletes the contents of the dict
-
opt_get
(value)¶ Safely query for the value from the
opt
property.Parameters: value (str) – a key in the opt
propertyReturns: the corresponding value, if the key exists. None
, otherwise.
-
reverse
()¶ Reverses the evaluated points
-
class
geomdl.shapes.analytic.
Sphere
(**kwargs)¶ Bases:
geomdl.shapes.analytic.AnalyticGeometry
Analytic sphere geometry
Finds the points on a sphere using the following equation:
- Keyword Arguments:
radius
: radius of the sphere. Default: 1origin
: coordinates of the sphere center. Default: (0, 0, 0)
-
data
¶ Returns a dict which contains the geometry data.
Please refer to the wiki for details on using this class member.
-
dimension
¶ Spatial dimension.
Please refer to the wiki for details on using this class member.
Getter: Gets the spatial dimension, e.g. 2D, 3D, etc. Type: int
-
evalpts
¶ Evaluated points.
Please refer to the wiki for details on using this class member.
Getter: Gets the coordinates of the evaluated points Type: list
-
evaluate
(**kwargs)¶ Evaluates the sphere.
- Keyword Arguments:
start_theta
: start angle in degrees. Default: 0stop_theta
: stop angle in degrees. Default: 360jump_theta
: angle increment in degrees. Default: 0.5start_phi
: start angle in degrees. Default: 0stop_phi
: stop angle in degrees. Default: 180jump_phi
: angle increment in degrees. Default: 0.25
-
id
¶ Object ID (as an integer).
Please refer to the wiki for details on using this class member.
Getter: Gets the object ID Setter: Sets the object ID Type: int
-
name
¶ Object name (as a string)
Please refer to the wiki for details on using this class member.
Getter: Gets the object name Setter: Sets the object name Type: str
-
opt
¶ Dictionary for storing custom data in the current geometry object.
opt
is a wrapper to a dict in key => value format, where key is string, value is any Python object. You can useopt
property to store custom data inside the geometry object. For instance:geom.opt = ["face_id", 4] # creates "face_id" key and sets its value to an integer geom.opt = ["contents", "data values"] # creates "face_id" key and sets its value to a string print(geom.opt) # will print: {'face_id': 4, 'contents': 'data values'} del geom.opt # deletes the contents of the hash map print(geom.opt) # will print: {} geom.opt = ["body_id", 1] # creates "body_id" key and sets its value to 1 geom.opt = ["body_id", 12] # changes the value of "body_id" to 12 print(geom.opt) # will print: {'body_id': 12} geom.opt = ["body_id", None] # deletes "body_id" print(geom.opt) # will print: {}
Please refer to the wiki for details on using this class member.
Getter: Gets the dict Setter: Adds key and value pair to the dict Deleter: Deletes the contents of the dict
-
class
geomdl.shapes.analytic.
Rectangle
(**kwargs)¶ Bases:
geomdl.shapes.analytic.AnalyticGeometry
Analytic rectangle geometry
Finds the points on a rectangle with the size of using the following equation:
- Keyword Arguments:
a
: length of the side on the u-direction. Default: 1b
: length of the side on the v-direction. Default: 1origin
: coordinates of the rectangle center. Default: (0, 0)
-
data
¶ Returns a dict which contains the geometry data.
Please refer to the wiki for details on using this class member.
-
dimension
¶ Spatial dimension.
Please refer to the wiki for details on using this class member.
Getter: Gets the spatial dimension, e.g. 2D, 3D, etc. Type: int
-
evalpts
¶ Evaluated points.
Please refer to the wiki for details on using this class member.
Getter: Gets the coordinates of the evaluated points Type: list
-
evaluate
(**kwargs)¶ Evaluates the rectangle.
- Keyword Arguments:
start
: start angle in degrees. Default: 0stop
: stop angle in degrees. Default: 360jump
: angle increment in degrees. Default: 0.5
-
id
¶ Object ID (as an integer).
Please refer to the wiki for details on using this class member.
Getter: Gets the object ID Setter: Sets the object ID Type: int
-
name
¶ Object name (as a string)
Please refer to the wiki for details on using this class member.
Getter: Gets the object name Setter: Sets the object name Type: str
-
opt
¶ Dictionary for storing custom data in the current geometry object.
opt
is a wrapper to a dict in key => value format, where key is string, value is any Python object. You can useopt
property to store custom data inside the geometry object. For instance:geom.opt = ["face_id", 4] # creates "face_id" key and sets its value to an integer geom.opt = ["contents", "data values"] # creates "face_id" key and sets its value to a string print(geom.opt) # will print: {'face_id': 4, 'contents': 'data values'} del geom.opt # deletes the contents of the hash map print(geom.opt) # will print: {} geom.opt = ["body_id", 1] # creates "body_id" key and sets its value to 1 geom.opt = ["body_id", 12] # changes the value of "body_id" to 12 print(geom.opt) # will print: {'body_id': 12} geom.opt = ["body_id", None] # deletes "body_id" print(geom.opt) # will print: {}
Please refer to the wiki for details on using this class member.
Getter: Gets the dict Setter: Adds key and value pair to the dict Deleter: Deletes the contents of the dict
-
opt_get
(value)¶ Safely query for the value from the
opt
property.Parameters: value (str) – a key in the opt
propertyReturns: the corresponding value, if the key exists. None
, otherwise.
-
reverse
()¶ Reverses the evaluated points
Function Reference¶
Curves¶
-
geomdl.shapes.curve2d.
full_circle
(radius=1)¶ Generates a full NURBS circle from 9 control points.
Parameters: radius (int, float) – radius of the circle Returns: a NURBS curve Return type: NURBS.Curve
-
geomdl.shapes.curve2d.
full_circle2
(radius=1)¶ Generates a full NURBS circle from 7 control points.
Parameters: radius (int, float) – radius of the circle Returns: a NURBS curve Return type: NURBS.Curve
Surfaces¶
-
geomdl.shapes.surface.
cylinder
(radius=1, height=1)¶ Generates a cylindrical NURBS surface.
Parameters: - radius (int, float) – radius of the cylinder
- height (int, float) – height of the cylinder
Returns: a NURBS surface
Return type: NURBS.Surface
Volumes¶
-
geomdl.shapes.volume.
scordelis_lo
(radius=25, thickness=0.25, length=50, angle=40, **kwargs)¶ Generates a Scordelis-Lo Roof.
The Scordelis-Lo roof is a classical test case for linear static analysis. Please refer to the following articles for details:
- https://doi.org/10.14359/7796
- https://doi.org/10.1016/0045-7825(85)90035-0
- https://doi.org/10.1016/j.cma.2010.03.029
- Keyword Arguments:
jump_angle
: iteration step for angle value. Default: 2jump_length
: iteration step for length value. Default: 2degree_u
: degree of the volume (u-dir). Default: 2degree_v
: degree of the volume (v-dir). Default: 2size_u
: number of control points (u-dir). Default: degree_u + 2size_v
: number of control points (v-dir). Default: degree_v + 2
Parameters: - radius (int, float) – radius (R)
- thickness (int, float) – thickness (t)
- length (int, float) – length (L)
- angle (int, float) – angle in degrees (Theta)
Returns: Scordelis-Lo Roof as a shell/volume
Return type: BSpline.Volume