mpacts.geometrygenerators. boolean3Dshapegenerator

In order to be able to use this module import it like this:

import mpacts.geometrygenerators.boolean3Dshapegenerator
#or assign it to a shorter name
import mpacts.geometrygenerators.boolean3Dshapegenerator as bd

Boolean3DShapeGenerator

class mpacts.geometrygenerators.boolean3Dshapegenerator.Boolean3DShapeGenerator(tolerance=2.220446049250313e-12)

Bases: object

Creates set of vertices for cubic, spherical, circular and cylindrical objects in 3D and application of Boolean functions ‘And’, ‘Xor’ and ‘Or’

Required input:
-Cubic: addVerticesCub(range_x,range_y,range_z,dist,boolean) -Spherical: addVerticesSphere(center,r,dist,boolean) -Circular: addVerticesCirc(center,r,plane,dist, boolean) -Cylindrical: addVerticesCyl(center,r,plane,range_l,dist,boolean) -Ellipse: addVerticesEllipse(center,a,b,dist,boolean) !Only for ellipse in xy-plane with x and y the major axes
Parameters:
-range_x list containing min and max x-value
-range_y list containing min and max y-value
-range_z list containing min and max z-value
-center central coordinate of sphere/circle
-r radius
-plane plane of circle or plane perpendicular to length axis cylinder
-range_l list containing min and max value of cylinder on axis perpendicular to plane
-dist distance between vertices
-boolean Boolean operator, can be ‘None’, ‘And’, ‘Xor’ or ‘Or’.
Boolean3DShapeGenerator(name, parent, **kwargs)
addVerticesCirc(center=[0, 0, 0], r=0.0, plane='xy', dist=1.0, boolean='None')

Make a circle of vertices

Parameters:
-center central coordinate of circle
-r radius
-plane plane of circle
-dist distance between vertices
-boolean Boolean operator, can be ‘None’, ‘And’, ‘Xor’ or ‘Or’.
addVerticesCub(range_x=[0.1, 0.1], range_y=[0.1, 0.1], range_z=[0.1, 0.1], dist=1.0, boolean='None')

Make a cube of vertices

Parameters:
-range_x list containing min and max x-value
-range_y list containing min and max y-value
-range_z list containing min and max z-value
-dist distance between vertices
-boolean Boolean operator, can be ‘None’, ‘And’, ‘Xor’ or ‘Or’.
addVerticesCyl(center=[0, 0, 0], r=0.0, plane='xy', range_l=[0, 0], dist=1.0, boolean='None')

Make a cylinder of vertices

Parameters:
-center central coordinate of length axis of the cylinder
-r radius
-plane plane perpendicular to length axis cylinder
-range_l list containing min and max value of cylinder on axis perpendicular to plane
-dist distance between vertices
-boolean Boolean operator, can be ‘None’, ‘And’, ‘Xor’ or ‘Or’.
addVerticesEllipseXY(center=[0, 0, 0], a=0.0, b=0.0, dist=1.0, boolean='None')

Make a circle of vertices

Parameters:
-center central coordinate of circle
-a x-axis ellipse
-b y-axis ellipse
-dist distance between vertices
-boolean Boolean operator, can be ‘None’, ‘And’, ‘Xor’ or ‘Or’.
addVerticesSphere(center=[0, 0, 0], r=0.0, dist=1.0, boolean='None')

Make a sphere of vertices

Parameters:
-center central coordinate of sphere
-r radius
-dist distance between vertices
-boolean Boolean operator, can be ‘None’, ‘And’, ‘Xor’ or ‘Or’.
findVertex(x, w)
getVertices()

Returns a list of tuples of the generated vertices.

rotateObj(center=[0, 0, 0], axis='z', angle=0.0)

Rotate object around axis (x, y or z) in selected point

translateObj(x=0.0, y=0.0, z=0.0)

Translate object in x, y and z-direction

mpacts.geometrygenerators.boolean3Dshapegenerator.tuple_from_dist(dist)