cPy.PrimAPI module

Contents

cPy.PrimAPI module#

class SpiralProfile(value)[source]#

Bases: Enum

The profile type of the spiral.
CIRCLE = 0#
RECTANGLE = 1#
class FontStyle(value)[source]#

Bases: Enum

Enumeration of the string drawing styles.
Regular = 0#
Italic = 1#
Underline = 2#
StrikeThrough = 4#
class FontWeight(value)[source]#

Bases: Enum

Dont = 0#
Thin = 100#
ExtraLight = 200#
Light = 300#
Normal = 400#
Medium = 500#
DemiBold = 600#
Bold = 700#
ExtraBold = 800#
Black = 900#
class ThreadProfile(value)[source]#

Bases: Enum

thread profile types
ThreadNone = -1#
ThreadTriangle = 0#
ThreadTrapeze = 1#
ThreadRectangular = 2#
ThreadRound = 3#
ThreadPersistent = 4#
class ThreadStudBodyType(value)[source]#

Bases: Enum

thread body type
StudCylinder = 0#
StudCone = 1#
class SlitType(value)[source]#

Bases: Enum

enumeration the slit types
none = -1#
Slot = 0#
Phillipse = 1#
Pozidriv = 2#
Robertson = 3#
HexSocket = 4#
SecurityHexSocket = 5#
Torx = 6#
SecurityTorx = 7#
TriWing = 8#
TorqSet = 9#
TripleSquare = 10#
Polydrive = 11#
DoubleSquare = 12#
SplineDrive = 13#
DoubleHex = 14#
Bristol = 15#
Pentalobular = 16#
Frearson = 17#
SnakeEyes = 18#
TA = 19#
TP3 = 20#
MorTorq = 21#
ClutCHG = 22#
ClutCHA = 23#
GroupEyes = 24#
class BoltHeadType(value)[source]#

Bases: Enum

enumeration the types of the bolt head
BoltNone = -1#
BoltHexa = 0#
Countersunk = 1#
BoltRound = 2#
Pan = 3#
Dome = 4#
Oval = 5#
Square = 6#
TShaped = 7#
Cylinder = 8#
Lamb = 9#
Rim = 10#
Eye = 11#
Bugle = 12#
Clop = 13#
class NutType(value)[source]#

Bases: Enum

enumeration the types of the nut
NutNone = -1#
NutHexa = 0#
Quard = 1#
Acorn = 2#
Lowacorn = 3#
NutFlange = 4#
Slits = 5#
Radial = 6#
NutLamb = 7#
NutRim = 8#
Selflock = 9#
NutTShaped = 10#
Clamplever = 11#
NtCount = 12#
class ThreadSurface(value)[source]#

Bases: Enum

ThreadCylinder = 0#
ThreadCone = 1#
ThreadEdge = 2#
class prim[source]#

Bases: object

The abstract prim class.
class_name() any[source]#
get the primitive class name.
name() any[source]#
get the primitive object name.
add(v: Volume)[source]#
add the prim into scene
Parameters:

v (Volume) – the scene volume reference

subtract(v: Volume)[source]#
subtract the prim from scene
Parameters:

v (Volume) – the scene volume reference

intersect(v: Volume)[source]#
intersect the prim into scene
Parameters:

v (Volume) – the scene volume reference

merge(v: Volume, op: BoolOpType)[source]#
merge the prim into scene
Parameters:
  • v (Volume) – the scene volume reference

  • op (BoolOpType) – the type of the merge

mesh() Mesh[source]#
get the mesh prim
Returns:

mesh object

Return type:

cPy.CoreAPI.Mesh

color(colorid: str) prim[source]#
assign the color to the primitive (in voxels)
Parameters:

colorid (str) – the color in any suitable form: “RGB”, “ARGB”, “RRGGBB”, “AARRGGBB”, “#RGB”, “#ARGB”, “#RRGGBB”, “#AARRGGBB”,

any web-color common name as “red”, “green”, “purple”, google “webcolors”
Returns:

the reference

Return type:

prim

gloss(value: float) prim[source]#
assign the gloss for the voxel primitive, it will work only if the color already assigned
Parameters:

value (float) – the [0..1] value of the gloss

Returns:

the reference

Return type:

prim

roughness(value: float) prim[source]#
assign the roughness for the voxel primitive, it will work only if the color already assigned
Parameters:

value (float) – the [0..1] value of the roughness

Returns:

the reference

Return type:

prim

metal(value: float) prim[source]#
the metalliclty value for the voxel primitive, it will work only if the color already assigned
Parameters:

value (float) – the [0..1] metal value

Returns:

the reference

Return type:

prim

opacity(value: float) prim[source]#
assign the opacity of the color over the voxel primitive. The color should be assigned before you assign the opacity,
for example p.color(“red”).opacity(0.5)
Parameters:

value (float) – the opacity value [0..1]

Returns:

the reference

Return type:

prim

details() float[source]#
get the detail level
Returns:

detail level

Return type:

float

transform() any[source]#
get the transform matrix
Returns:

matrix

Return type:

any

scale() any[source]#
get the scale
Returns:

the scale 3d vector

Return type:

any

translate(x: float, y: float, z: float) prim[source]#
Set the primitive translation
Parameters:
  • x (float) – the new x primitive position

  • y (float) – the new y primitive position

  • z (float) – the new z primitive position

Returns:

this primitive reference

Return type:

prim

x(x: float) prim[source]#
shift the primitive along the x - axis
Parameters:

x (float) – the x value

Returns:

this primitive reference

Return type:

prim

y(y: float) prim[source]#
shift the primitive along the y - axis
Parameters:

y (float) – the y value

Returns:

this primitive reference

Return type:

prim

z(z: float) prim[source]#
shift the primitive along the z - axis
Parameters:

z (float) – the z value

Returns:

this primitive reference

Return type:

prim

auto_divide(average_div: float) prim[source]#
set the auto devide
Parameters:

average_div (float) – the average divide factor

Returns:

this prim reference

Return type:

prim

step_divide(step: float) prim[source]#
set the step devide
Parameters:

step (float) – the step divide factor

Returns:

primitive reference

Return type:

prim

fillet(radius: float) prim[source]#
set the fillet
Parameters:

radius (float) – the fillet radius

Returns:

this primitive reference

Return type:

prim

static debug_on(isOn: bool = True)[source]#
indicates whether to turn on or off the debug mode.
Parameters:

isOn (bool) – if this parameter is true, the debug mode is on, otherwise the debug mode is off.

static debug_clear()[source]#
clear the debug info for primitive operations
static push_transform(t: any)[source]#
set the global transform matrix to all primitives
Parameters:

t – the matrix

static push_translate(d: any)[source]#
Set the translation to all primitives
Not implemented yet
Parameters:

d – the new position of the primitives

static push_scale(s: any)[source]#
Set the scale to all primitives
Not implemented yet
static push_details(details_modulator: float)[source]#
set the detail level to all primitives
Not implemented yet
Parameters:

details_modulator (float) – datail level

static reset_transform()[source]#
reset the global transform matrix
Not implemented yet
fillet_relative() float[source]#
calculates a fillet relative value (0..1).
Returns:

fillet relative value

Return type:

float

class box(pos: any, size: any, fillet: float)[source]#

Bases: prim

The box.
static dynamic_cast(pObject: prim) box[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a box class or its descendant, and if so, returns the specified object, but of the box type.
axis(directionX: any, directionY: any, directionZ: any) box[source]#
set the x, y and z direction
Parameters:
  • directionX – the x-direction

  • directionY – the y-direction

  • directionZ – the z-direction

Returns:

box reference

Return type:

box

reset_axis() box[source]#
reset the x, y and z direction
Returns:

box reference

Return type:

box

axis_x() any[source]#
get the x-axis
Returns:

vec3 axis

Return type:

any

axis_y() any[source]#
get the y-axis
Returns:

vec3 axis

Return type:

any

axis_z() any[source]#
get the z-axis
Returns:

vec3 axis

Return type:

any

divide(nx: int, ny: int, nz: int) box[source]#
set the number deviding
Parameters:
  • nx (int) – number deviding along the x-axis

  • ny (int) – number deviding along the y-axis

  • nz (int) – number deviding along the z-axis

Returns:

box reference

Return type:

box

size() any[source]#
get the box size.
Returns:

size

Return type:

any

fillet_relative() float[source]#
calculates a fillet relative value (0..1).
Returns:

fillet relative value

Return type:

float

class torus(pos: any, ringRadius: float, crossSectionRadius: float)[source]#

Bases: box

The torus.
static dynamic_cast(pObject: prim) torus[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a torus class or its descendant, and if so, returns the specified object, but of the torus type.
slices() int[source]#
get the number of slices in the mesh.
Returns:

number of slices

Return type:

int

rings() int[source]#
get the number of rings in the mesh.
Returns:

number of rings

Return type:

int

radius() float[source]#
get the ring radius.
Returns:

ring radius

Return type:

float

section_radius() float[source]#
get the cross section radius.
Returns:

cross section radius

Return type:

float

diameter() float[source]#
get the ring diameter.
Returns:

ring diameter

Return type:

float

section_diameter() float[source]#
get the cross section diameter.
Returns:

cross section diameter

Return type:

float

sector_on() bool[source]#
get the flag of creating a portion of torus. Default = false.
Returns:

the sector switch

Return type:

bool

slices_angle() float[source]#
get the angle for torus slices
Returns:

the slices angle

Return type:

float

rings_angle() float[source]#
get the angle for torus rings
Returns:

the rings angle

Return type:

float

class sphere(pos: any, radius: float)[source]#

Bases: prim

The sphere.
static dynamic_cast(pObject: prim) sphere[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a sphere class or its descendant, and if so, returns the specified object, but of the sphere type.
radius() float[source]#
get the radius of the sphere.
Returns:

radius value

Return type:

float

diameter() float[source]#
get the diameter of the sphere.
Returns:

diameter value

Return type:

float

sub_division() int[source]#
get the degree of subdivision triangular or cubic division of the sphere.
Returns:

subdivision degree.

Return type:

int

sub_div_mode() any[source]#
get the division mode for the mesh.
Returns:

mode of the mesh division

Return type:

any

rings() int[source]#
get the number of rings in the mesh.
Returns:

number of rings

Return type:

int

slices() int[source]#
get the number of slices in the mesh.
Returns:

number of slices

Return type:

int

sector_on() bool[source]#
get the flag of creating a portion of sphere. Default = false.
Returns:

the sector switch

Return type:

bool

slice_from() float[source]#
get the angle where the sphere slice begins.
Returns:

the slice begin angle

Return type:

float

slice_to() float[source]#
get the angle where the sphere slice ends.
Returns:

the slice end angle

Return type:

float

ring_from() float[source]#
get the angle where the sphere ring begins.
Returns:

the ring begin angle

Return type:

float

ring_to() float[source]#
get the angle where the sphere ring ends.
Returns:

the ring end angle

Return type:

float

class ellipse(size: any)[source]#

Bases: sphere

The ellipse.
static dynamic_cast(pObject: prim) ellipse[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a ellipse class or its descendant, and if so, returns the specified object, but of the ellipse type.
axis(directionX: any, directionY: any = 3, directionZ: any = 3) ellipse[source]#
set the axis x, y and z direction
Parameters:
  • directionX – the x-direction

  • directionY – the y-direction

  • directionZ – the z-direction

Returns:

ellipse reference

Return type:

ellipse

reset_axis() ellipse[source]#
reset the x, y and z directions
Returns:

ellipse reference

Return type:

ellipse

size() any[source]#
get the size of the ellipse.
Returns:

ellipse size

Return type:

any

class cylinder(posTop: any, posBottom: any, radiusTop: float, radiusBottom: float, fillet: float = 0.0)[source]#

Bases: prim

The cylinder.
static dynamic_cast(pObject: prim) cylinder[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a cylinder class or its descendant, and if so, returns the specified object, but of the cylinder type.
positionTop() any[source]#
get the top position.
Returns:

position

Return type:

any

positionBottom() any[source]#
get the bottom position.
Returns:

position

Return type:

any

radiusTop() float[source]#
get the top radius.
Returns:

radius value

Return type:

float

radiusBottom() float[source]#
get the bottom radius.
Returns:

radius value

Return type:

float

radius() float[source]#
get the radius.
Returns:

radius value

Return type:

float

diameterTop() float[source]#
get the top diameter.
Returns:

diameter value

Return type:

float

diameterBottom() float[source]#
get the bottom diameter.
Returns:

diameter value

Return type:

float

diameter() float[source]#
get the diameter.
Returns:

diameter value

Return type:

float

height() float[source]#
get the height.
Returns:

height value

Return type:

float

sectorAngle() float[source]#
get the sector angle.
Returns:

angle value

Return type:

float

topCapScale() float[source]#
get the top cap scale.
Returns:

the scale value

Return type:

float

bottomCapScale() float[source]#
get the bottom cap scale.
Returns:

the scale value

Return type:

float

slices() int[source]#
get the number of slices in the mesh.
Returns:

number of slices.

Return type:

int

rings() int[source]#
get the number of rings in the mesh.
Returns:

number of rings.

Return type:

int

caps() int[source]#
get the number of caps in the mesh.
Returns:

number of caps.

Return type:

int

fillet_relative() float[source]#
calculates a fillet relative value (0..1).
Returns:

fillet relative value

Return type:

float

class cone(posTop: any, posBottom: any, radiusBottom: float, fillet: float = 0.0)[source]#

Bases: cylinder

The cone.
static dynamic_cast(pObject: prim) cone[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a cone class or its descendant, and if so, returns the specified object, but of the cone type.
radius() float[source]#
get the value of radius.
Returns:

radius value

Return type:

float

diameter() float[source]#
get the value of diameter.
Returns:

diameter value

Return type:

float

fillet_relative() float[source]#
calculates a fillet relative value (0..1).
Returns:

fillet relative value

Return type:

float

class tube(posTop: any, posBottom: any, radiusTop: float, radiusBottom: float, relativeHoleRadius: float, fillet: float)[source]#

Bases: cylinder

The tube.
static dynamic_cast(pObject: prim) tube[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a tube class or its descendant, and if so, returns the specified object, but of the tube type.
relativeHoleRadius() float[source]#
get the relative value of the hole radius.
Returns:

relative value (0..1)

Return type:

float

thickness() float[source]#
get the relative value of the hole radius.
Returns:

relative value (0..1)

Return type:

float

fillet_relative() float[source]#
calculates a fillet relative value (0..1).
Returns:

fillet relative value

Return type:

float

class gear(posTop: any, posBottom: any, radiusTop: float, radiusBottom: float, depth: float = 0.1, sharpness: float = 0.5, order: int = 16)[source]#

Bases: tube

The gear.
static dynamic_cast(pObject: prim) gear[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a gear class or its descendant, and if so, returns the specified object, but of the gear type.
depth() float[source]#
get the depth value.
Returns:

depth value

Return type:

float

sharpness() float[source]#
get the depth value.
Returns:

depth value

Return type:

float

order() int[source]#
get the number of teeth in gear.
Returns:

the number of teeth

Return type:

int

class ngon(posTop: any, posBottom: any, radiusTop: float, radiusBottom: float, order: int)[source]#

Bases: gear

The ngon.
static dynamic_cast(pObject: prim) ngon[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a ngon class or its descendant, and if so, returns the specified object, but of the ngon type.
fillet_relative() float[source]#
calculates a fillet relative value (0..1).
Returns:

fillet relative value

Return type:

float

class capsule(posTop: any, posBottom: any, radiusTop: float, radiusBottom: float)[source]#

Bases: cylinder

The capsule.
static dynamic_cast(pObject: prim) capsule[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a capsule class or its descendant, and if so, returns the specified object, but of the capsule type.
class spiral(out_radius: float, in_radius: float, _2: float, nturns: float)[source]#

Bases: prim

The spiral.
static dynamic_cast(pObject: prim) spiral[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a spiral class or its descendant, and if so, returns the specified object, but of the spiral type.
radius() float[source]#
get the outer radius.
Returns:

outer radius

Return type:

float

profile_radius() float[source]#
get the profile radius.
Returns:

profile radius

Return type:

float

diameter() float[source]#
get the outer diameter.
Returns:

outer diameter

Return type:

float

profile_diameter() float[source]#
get the profile diameter.
Returns:

profile diameter

Return type:

float

turns() int[source]#
get the number of turns.
Returns:

turns count

Return type:

int

step() float[source]#
get the spiral step.
Returns:

step value

Return type:

float

profile_type(type: SpiralProfile) spiral[source]#
set the type of profile (circle or rectangle).
Parameters:

type (SpiralProfile) – profile type

Returns:

spiral reference

Return type:

spiral

profile_rect(width: float, height: float) spiral[source]#
set the dimensions for the rectangle profile.
Parameters:
  • width (float) – the width value

  • height (float) – the height value

Returns:

spiral reference

Return type:

spiral

clock_wise() bool[source]#
get the clokwise direction of the spiral.
Returns:

the clokwise direction( true or false)

Return type:

bool

profile_height() float[source]#
get the profile height for rectangle profile.
Returns:

the profile height

Return type:

float

profile_width() float[source]#
get the profile width for rectangle profile.
Returns:

the profile width

Return type:

float

slices() int[source]#
get the number of slices in the mesh.
Returns:

number of slices

Return type:

int

rings() int[source]#
get the number of rings in the mesh.
Returns:

number of rings

Return type:

int

caps() int[source]#
get the number of caps in the mesh.
Returns:

number of caps

Return type:

int

class FontInfo[source]#

Bases: object

Holds the general information about font
size: int#
weight: int#
style: int#
fname: str#
class Font(_0: str, _1: int)[source]#

Bases: object

size() int[source]#
get the font size
Returns:

font size

Return type:

int

weight() int[source]#
get the font weight
Returns:

font weight

Return type:

int

style() int[source]#
get the font style
Returns:

the font style

Return type:

int

name() str[source]#
get the font name
Returns:

the font name

Return type:

str

select()[source]#
selects a font object into the viewport
class text(s: str)[source]#

Bases: prim

text primitive
static dynamic_cast(pObject: prim) text[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a text class or its descendant, and if so, returns the specified object, but of the text type.
string() any[source]#
get the text’s string.
Returns:

the string

Return type:

any

font() Font[source]#
get the font object
Returns:

font object

Return type:

Font

width() float[source]#
get the text width
Returns:

the width value

Return type:

float

depth() float[source]#
get the text depth
Returns:

the depth value

Return type:

float

bendRadius() float[source]#
get the bend radius.
Returns:

the bend radius of the text

Return type:

float

extraRotation() float[source]#
get the rotate angle around the x-axis.
Returns:

the rotate angle

Return type:

float

invertBending() float[source]#
get the invert of the text bending.
Returns:

the invert bending

Return type:

float

class lathe[source]#

Bases: box

lathe primitive
static dynamic_cast(pObject: prim) lathe[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a lathe class or its descendant, and if so, returns the specified object, but of the lathe type.
type() any[source]#
get the lathe type.
Returns:

the type value

Return type:

any

add_point(point: any, st: int) lathe[source]#
add the point into curve
Parameters:
  • point – the 2d point

  • st (int) – the point state

Returns:

lathe reference

Return type:

lathe

profile() any[source]#
get the pointer to the profile
Returns:

the profile pointer

Return type:

any

reset() lathe[source]#
reset the curve points
clear() lathe[source]#
clear points of the profile
class image[source]#

Bases: text

image primitive
static dynamic_cast(pObject: prim) image[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a image class or its descendant, and if so, returns the specified object, but of the image type.
topTexture() any[source]#
get the top texture
Returns:

the string of the image file name

Return type:

any

topBumpTexture() any[source]#
get the top bump texture
Returns:

the string of the image file name

Return type:

any

bottomTexture() any[source]#
get the bottom texture
Returns:

the string of the image file name

Return type:

any

bottomBumpTexture() any[source]#
get the bottom bump texture
Returns:

the string of the image file name

Return type:

any

strencilTexture() any[source]#
get the strencil texture
Returns:

the string of the image file name

Return type:

any

bottomStrencilTexture() any[source]#
get the bottom strencil texture
Returns:

the string of the image file name

Return type:

any

basicThickness() float[source]#
get the basic thickness of image
Returns:

the thickness value

Return type:

float

bumpThickness() float[source]#
get the bump thickness of image
Returns:

the thickness value

Return type:

float

taperAngle() float[source]#
get the angle of tapering of image
Returns:

the taper angle value

Return type:

float

topBottomWeight() float[source]#
get the weight of the top and bottom image
Returns:

the weight value

Return type:

float

sizeInScene() float[source]#
get the size of image in the scene
Returns:

the size value

Return type:

float

class thread[source]#

Bases: prim

thread primitive
static dynamic_cast(pObject: prim) thread[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a thread class or its descendant, and if so, returns the specified object, but of the thread type.
diameter() float[source]#
get the diameter of the thread.
Returns:

thread diameter

Return type:

float

pitch() float[source]#
set the pitch of the thread.
Returns:

pitch value

Return type:

float

stub() float[source]#
get the stub length of the thread.
Returns:

stub length value

Return type:

float

height() float[source]#
get the height of the thread.
Returns:

height value

Return type:

float

turns() int[source]#
get the number of the thread turns.
Returns:

turns count

Return type:

int

clockwise() bool[source]#
get the clockwise of the thread.
Returns:

clockwise flag

Return type:

bool

close() bool[source]#
set the closed thread.
Returns:

closed flag

Return type:

bool

profile() ThreadProfile[source]#
get the thread profile type.
Returns:

profile type

Return type:

ThreadProfile

class threadStud[source]#

Bases: thread

thread stud primitive
static dynamic_cast(pObject: prim) threadStud[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a threadStud class or its descendant, and if so, returns the specified object, but of the threadStud type.
diameter() float[source]#
get the diameter of the thread.
Returns:

diameter value

Return type:

float

diameterTop() float[source]#
get the top diameter of the thread.
Returns:

diameter value

Return type:

float

diameterBottom() float[source]#
get the bottom diameter of the thread.
Returns:

diameter value

Return type:

float

length() float[source]#
get the length of the stud.
Returns:

length value

Return type:

float

threadLength() float[source]#
get the length of the thread.
Returns:

length value

Return type:

float

enableThread() bool[source]#
get the indicator of the enabled thread.
Returns:

enabled/disabled value

Return type:

bool

bodyType() ThreadStudBodyType[source]#
get the body type.
Returns:

type value

Return type:

ThreadStudBodyType

class Slit(w: float, h: float, d: float, t: SlitType)[source]#

Bases: object

class of the slits
type() int[source]#
get the slit type.
Returns:

type value

Return type:

int

width() float[source]#
get the width.
Returns:

width value

Return type:

float

height() float[source]#
get the height.
Returns:

height value

Return type:

float

depth() float[source]#
get the depth.
Returns:

depth value

Return type:

float

class HeadParams[source]#

Bases: object

setData(_0: int, param: any) HeadParams[source]#
set the parameters data with specified type.
Parameters:

_type (int) – head type

getData() any[source]#
get the head data
Returns:

pointer to the head data

Return type:

any

copy(h: HeadParams)[source]#
copies the HeadParams object
release()[source]#
release the data
class HeadBaseParams(_0: float, _1: float)[source]#

Bases: object

HeadBaseParams struct of the head data
diameter(_0: float) HeadBaseParams[source]#
set the diameter.
Parameters:

_d (float) – diameter

Returns:

HeadBaseParams reference

Return type:

HeadBaseParams

height(_0: float) HeadBaseParams[source]#
set the height.
Parameters:

_h (float) – height

Returns:

HeadBaseParams reference

Return type:

HeadBaseParams

class TShapedParams(_0: float, _1: float, _2: float)[source]#

Bases: object

struct of the TShapedParams data
diameter(_0: float) TShapedParams[source]#
set the diameter.
Parameters:

_d (float) – diameter

Returns:

TShapedParams reference

Return type:

TShapedParams

height(_0: float) TShapedParams[source]#
set the height.
Parameters:

_h (float) – height

Returns:

TShapedParams reference

Return type:

TShapedParams

width(_0: float) TShapedParams[source]#
set the width.
Parameters:

_w (float) – width

Returns:

TShapedParams reference

Return type:

TShapedParams

class LambParams(_0: float, _1: float, _2: float, _3: float, _4: float, _5: float)[source]#

Bases: object

struct of the LambParams data
length(_0: float) LambParams[source]#
set the length.
Parameters:

_l (float) – length

Returns:

LambParams reference

Return type:

LambParams

diameterTop(_0: float) LambParams[source]#
set the top diameter.
Parameters:

_d (float) – top diameter

Returns:

LambParams reference

Return type:

LambParams

diameterBottom(_0: float) LambParams[source]#
set the bottom diameter.
Parameters:

_d (float) – bottom diameter

Returns:

LambParams reference

Return type:

LambParams

height(_0: float) LambParams[source]#
set the height.
Parameters:

_h (float) – height

Returns:

LambParams reference

Return type:

LambParams

headHeight(_0: float) LambParams[source]#
set the head height.
Parameters:

_h (float) – height

Returns:

LambParams reference

Return type:

LambParams

thickness(_0: float) LambParams[source]#
set the thickness.
Parameters:

_t (float) – thickness

Returns:

LambParams reference

Return type:

LambParams

class RimParams(_0: float, _1: float, _2: float, _3: float)[source]#

Bases: object

struct of the RimParams data
shoulderDiameter(_0: float) RimParams[source]#
set the shoulder diameter.
Parameters:

_d (float) – diameter

Returns:

RimParams reference

Return type:

RimParams

shoulderHeight(_0: float) RimParams[source]#
set the shoulder height.
Parameters:

_h (float) – height

Returns:

RimParams reference

Return type:

RimParams

inRingDiameter(_0: float) RimParams[source]#
set the inner ring diameter.
Parameters:

_d (float) – diameter

Returns:

RimParams reference

Return type:

RimParams

outRingDiameter(_0: float) RimParams[source]#
set the outer ring diameter.
Parameters:

_d (float) – diameter

Returns:

RimParams reference

Return type:

RimParams

class EyeParams(_0: float, _1: float, _2: float)[source]#

Bases: object

struct of the EyeParams data
inRingDiameter(_0: float) EyeParams[source]#
set the inner ring diameter.
Parameters:

_d (float) – diameter

Returns:

EyeParams reference

Return type:

EyeParams

outRingDiameter(_0: float) EyeParams[source]#
set the outer ring diameter.
Parameters:

_d (float) – diameter

Returns:

EyeParams reference

Return type:

EyeParams

thickness(_0: float) EyeParams[source]#
set the thickness.
Parameters:

_t (float) – thickness

Returns:

EyeParams reference

Return type:

EyeParams

class boltHead[source]#

Bases: prim

bolt head primitive
static dynamic_cast(pObject: prim) boltHead[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a boltHead class or its descendant, and if so, returns the specified object, but of the boltHead type.
head(_0: int, data: any) boltHead[source]#
set the head object with specified type and data.
Parameters:

_type (int) – head type

Returns:

bolt head reference

Return type:

boltHead

slit() Slit[source]#
get the const slit object.
Returns:

slit object reference

Return type:

Slit

class NutHeadBaseParams(t: NutType, d: float, h: float)[source]#

Bases: object

diameter() float[source]#
get the diameter.
Returns:

diameter

Return type:

float

height() float[source]#
get the height.
Returns:

height value

Return type:

float

type() int[source]#
set the nut type.
Returns:

type value.

Return type:

int

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the object.
Parameters:

p (NutHeadBaseParams) – pointer to the object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an object.

Return type:

NutHeadBaseParams

class NutHexaParams(d: float, h: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutHexaParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutHexaParams class or its descendant, and if so, returns the specified object, but of the NutHexaParams type.
class NutAcornParams(d: float, h: float, h1: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutAcornParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutAcornParams class or its descendant, and if so, returns the specified object, but of the NutAcornParams type.
facetHeight() float[source]#
get the facet height.
Returns:

facet height value.

Return type:

float

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the NutAcornParams object.
Parameters:

p (NutHeadBaseParams) – pointer to the NutAcornParams object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an NutAcornParams object.

Return type:

NutHeadBaseParams

class NutLowAcornParams(d: float, h: float, h1: float)[source]#

Bases: NutAcornParams

static dynamic_cast(pObject: NutHeadBaseParams) NutLowAcornParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutLowAcornParams class or its descendant, and if so, returns the specified object, but of the NutLowAcornParams type.
class NutSelfLockParams(d: float, h: float, h1: float)[source]#

Bases: NutAcornParams

static dynamic_cast(pObject: NutHeadBaseParams) NutSelfLockParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutSelfLockParams class or its descendant, and if so, returns the specified object, but of the NutSelfLockParams type.
class NutTShapedParams(d: float, h: float, h1: float)[source]#

Bases: NutAcornParams

static dynamic_cast(pObject: NutHeadBaseParams) NutTShapedParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutTShapedParams class or its descendant, and if so, returns the specified object, but of the NutTShapedParams type.
class NutFlangeParams(d: float, h: float, fw: float, fh: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutFlangeParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutFlangeParams class or its descendant, and if so, returns the specified object, but of the NutFlangeParams type.
facetWidth() float[source]#
get the width.
Returns:

width value.

Return type:

float

facetHeight() float[source]#
get the height.
Returns:

height value.

Return type:

float

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the NutFlangeParams object.
Parameters:

p (NutHeadBaseParams) – pointer to the NutFlangeParams object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an NutFlangeParams object.

Return type:

NutHeadBaseParams

class NutRadialParams(d: float, h: float, d1: float, d2: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutRadialParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutRadialParams class or its descendant, and if so, returns the specified object, but of the NutRadialParams type.
holeDiameter() float[source]#
set the hole diameter.
Returns:

hole diameter

Return type:

float

holeDepth() float[source]#
get the hole depth.
Returns:

NutRadialParams hole depth

Return type:

float

holePlace() int[source]#
get the hole place.
Returns:

place flag 0 - face, 1 - side

Return type:

int

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the radial object.
Parameters:

p (NutHeadBaseParams) – pointer to the radial object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an radial object.

Return type:

NutHeadBaseParams

class NutLambParams(d: float, h: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutLambParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutLambParams class or its descendant, and if so, returns the specified object, but of the NutLambParams type.
length() float[source]#
get the length.
Returns:

length value

Return type:

float

diameterBottom() float[source]#
get the bottom diameter.
Returns:

bottom diameter

Return type:

float

diameterTop() float[source]#
get the top diameter.
Returns:

top diameter

Return type:

float

headHeight() float[source]#
get the head height.
Returns:

height value

Return type:

float

thickness() float[source]#
get the thickness.
Returns:

thickness value

Return type:

float

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the NutLambParams object.
Parameters:

p (NutHeadBaseParams) – pointer to the NutLambParams object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an NutLambParams object.

Return type:

NutHeadBaseParams

class NutSlitsParams(d: float, h: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutSlitsParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutSlitsParams class or its descendant, and if so, returns the specified object, but of the NutSlitsParams type.
width() float[source]#
get the width.
Returns:

width value.

Return type:

float

length() float[source]#
get the length.
Returns:

length value.

Return type:

float

count() int[source]#
get the count of NutSlitsParams.
Returns:

count value.

Return type:

int

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the NutSlitsParams object.
Parameters:

p (NutHeadBaseParams) – pointer to the NutSlitsParams object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an NutSlitsParams object.

Return type:

NutHeadBaseParams

class NutRimParams(d: float, h: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutRimParams[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutRimParams class or its descendant, and if so, returns the specified object, but of the NutRimParams type.
inRingDiameter() float[source]#
get the inner ring diameter.
Returns:

inner diameter

Return type:

float

outRingDiameter() float[source]#
get the outer ring diameter.
Returns:

outer diameter

Return type:

float

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the NutRimParams object.
Parameters:

p (NutHeadBaseParams) – pointer to the NutRimParams object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an NutRimParams object.

Return type:

NutHeadBaseParams

class NutClampLever(d: float, h: float)[source]#

Bases: NutHeadBaseParams

static dynamic_cast(pObject: NutHeadBaseParams) NutClampLever[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a NutClampLever class or its descendant, and if so, returns the specified object, but of the NutClampLever type.
holderDiameter() float[source]#
get the diameter of the holder.
Returns:

holder diameter

Return type:

float

length() float[source]#
get the length.
Returns:

length value

Return type:

float

copy(p: NutHeadBaseParams = None) NutHeadBaseParams[source]#
copies the NutClampLever object.
Parameters:

p (NutHeadBaseParams) – pointer to the NutClampLever object to copy. If the pointer equals to null then the object is duplicated

Returns:

the pointer to a copy of an NutClampLever object.

Return type:

NutHeadBaseParams

class nut[source]#

Bases: prim

nut primitive
static dynamic_cast(pObject: prim) nut[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a nut class or its descendant, and if so, returns the specified object, but of the nut type.
setTypeData(data: any) nut[source]#
set the typed data.
Parameters:

data – pointer to the data

Returns:

nut reference

Return type:

nut

getTypeData() any[source]#
get the typed data.
Returns:

pointer to the data

Return type:

any

threadDiameter() float[source]#
get the hole thread diameter.
Returns:

diameter

Return type:

float

pitch() float[source]#
get the thread pitch.
Returns:

pitch

Return type:

float

enableThread() bool[source]#
get the enabled thread.
Returns:

enabled flag

Return type:

bool

threadType() int[source]#
get the nut thread profile.
Returns:

thread type value.

Return type:

int

class bolt[source]#

Bases: prim

bolt primitive
static dynamic_cast(pObject: prim) bolt[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a bolt class or its descendant, and if so, returns the specified object, but of the bolt type.
head() boltHead[source]#
get the head object.
Returns:

head obj reference

Return type:

boltHead

diameter() float[source]#
get the bolt diameter.
Returns:

diameter

Return type:

float

pitch() float[source]#
get the thread pitch.
Returns:

pitch

Return type:

float

threadHeight() float[source]#
get the thread height.
Returns:

height value

Return type:

float

length() float[source]#
get the bolt length.
threadLength() float[source]#
get the thread length.
Returns:

length

Return type:

float

threadType() int[source]#
get the screw thread profile.
Returns:

thread type value.

Return type:

int

underhead() int[source]#
get the under head type.
Returns:

under head type value

Return type:

int

uwidth() float[source]#
get the underhead width.
Returns:

width value

Return type:

float

uheight() float[source]#
get the underhead height.
Returns:

height value

Return type:

float

nutType() int[source]#
get the nut type.
Returns:

type value

Return type:

int

nutLocation() float[source]#
get the nut location on the bolt.
Returns:

location value

Return type:

float

nutHeight() float[source]#
get the nut height on the bolt.
Returns:

location value

Return type:

float

class screw[source]#

Bases: prim

screw primitive
static dynamic_cast(pObject: prim) screw[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a screw class or its descendant, and if so, returns the specified object, but of the screw type.
head() boltHead[source]#
get the bolt head object.
Returns:

bolt head obj reference

Return type:

boltHead

diameter() float[source]#
get the screw diameter.
Returns:

diameter

Return type:

float

pitch() float[source]#
get the screw thread step(pitch).
Returns:

step value

Return type:

float

threadDiameter() float[source]#
get the thread diameter.
Returns:

diameter

Return type:

float

threadHeight() float[source]#
get the screw thread height.
Returns:

thread height value

Return type:

float

threadLength() float[source]#
get the screw thread length.
Returns:

length value

Return type:

float

length() float[source]#
get the screw length.
Returns:

length

Return type:

float

underhead() int[source]#
get the underhead type.
Returns:

type value

Return type:

int

uwidth() float[source]#
get the underhead width.
Returns:

width value

Return type:

float

uheight() float[source]#
get the underhead height.
Returns:

height value

Return type:

float

class washer[source]#

Bases: prim

washer primitive
static dynamic_cast(pObject: prim) washer[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a washer class or its descendant, and if so, returns the specified object, but of the washer type.
innerDiameter() float[source]#
get the inner diameter.
Returns:

diameter

Return type:

float

outerDiameter() float[source]#
get the outer diameter.
Returns:

diameter

Return type:

float

conusDiameter() float[source]#
get the diameter of the conus washer.
Returns:

diameter

Return type:

float

thickness() float[source]#
get the washer thickness.
Returns:

thickness value

Return type:

float

height() float[source]#
get the washer height.
Returns:

height value

Return type:

float

facet() bool[source]#
get the facet flag.
Returns:

facet flag value

Return type:

bool

type() any[source]#
get the washer type.
Returns:

type value

Return type:

any

class freeform[source]#

Bases: prim

freeform primitive
static dynamic_cast(pObject: prim) freeform[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a freeform class or its descendant, and if so, returns the specified object, but of the freeform type.
symx(x: bool) freeform[source]#
Enable the XYZ-mirror symmetry
Parameters:

x (bool) – true to enable x-symmetry, false to disable

Returns:

freeform reference

Return type:

freeform

symy(y: bool) freeform[source]#
Enable the XYZ-mirror symmetry
Parameters:

y (bool) – true to enable y-symmetry, false to disable

Returns:

freeform reference

Return type:

freeform

symz(z: bool) freeform[source]#
Enable the XYZ-mirror symmetry
Parameters:

z (bool) – true to enable z-symmetry, false to disable

Returns:

freeform reference

Return type:

freeform

size(v: any) freeform[source]#
set the free form size
Parameters:

v – vector size

Returns:

freeform reference

Return type:

freeform

ffname() str[source]#
get the free form name.
Returns:

the name

Return type:

str

ffsubname() str[source]#
get the free form sub name.
Returns:

the name

Return type:

str

SetPoint(i: int, point: any) freeform[source]#
set the knot point of the primitive.
Parameters:
  • i (int) – point index

  • point – the coordinates of the point

Returns:

the freeform reference

Return type:

freeform

CountPoints() int[source]#
get the account of the knot points
Returns:

count of points

Return type:

int

ResetPoints()[source]#
reset the knot points
objsList() any[source]#
gets the object’s list.
Returns:

objs list reference

Return type:

any

ffControlPoints() any[source]#
get the knot(control) points of the primitive.
Returns:

the points reference

Return type:

any