PolyNURBS (hwx.inspire.core)

Create free-form solid geometry that is smooth and continuous.

A PolyNURBS object represents geometry as a NURBS surface surrounded by a transparent polymesh cage. The shape of the PolyNURBS object is the result of the modifications made to the cage, which can be manipulated using the cage’s faces, edges, and vertices.

Attributes

active: Bool

autoCalcMotionContactResolution: Bool

autoCalculateCG: Bool

autoCalculateMass: Bool

autoCalculateMeshSize: Bool

autoCalculateMoment: Bool

autoCalculateThickness: Bool

cg: Location

color: Color

designSpace: Bool

detectCollisions: Bool

flexible: Bool

ground: Bool

ignoreFlexibility: Bool

ip: Inertia

mass: Double

material: Attribute

maxFreq: Double

maxMeshSize: Double

maxThickness: Double

minGap: Double

minMeshSize: Double

minThickness: Double

modeType: Enum

modifiable: Bool

morphable: Bool

motionContactResolution: Enum

movable: Bool

name: Attribute

numModes: Int

orderType: Enum

position: Attribute

rigidGroup: Attribute

sheetThickness: Double

strainCalculation: Bool

stressCalculation: Bool

transparency: Double

visible: Bool

volume: Double

Public Methods

classmethod create2DSurface (cls, numberRowsOfFaces=1, numberColumnOfFaces=1, cornerVertices=[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]], parent=None)

classmethod createBrick (cls, x=1, y=1, z=1, position=None, parent=None)

classmethod createCustomPolygon (cls, vertices, indices, edgeWeights=None, parent=None)

classmethod createPolygonMesh (cls, vertices, indices, edgeWeights=None, parent=None)

classmethod createSurfaceGrid (cls, numberRowsOfFaces=1, numberColumnOfFaces=1, cornerVertices=[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]], parent=None)

classmethod fit (cls, parts, numberOfFaces=500, curvature=0.5, autoCrease=False, system=None, symmetry=(0, 0, 0), parent=None)

classmethod fitSynthesis (cls, synthesis, curvature=50, numberOfFaces=2500, shrinkWrapSize=0.0019, autoCrease=False, intersect=True, symmetry=True, density=None)

bridge (self, faces)

closeHolesInSolid (self)

edit (self)

findAndFixBadFaces (self)

getFeatures (self, type=None, rep=’PolymeshRep’, **kwds)

mirror (self, areas, origin, normal, keepOriginal=True)

moveEdge (self, edge, direction, distance)

moveFace (self, face, direction, distance)

movePoints (self, deltaLocations)

setPointLocations (self, locations)

sharpen (self, edge, weight)

shell (self, areas, thickness=0)

splitArea (self, area, point1, point2)

Attribute Details

active : Bool

Returns or sets the object activeness.

Setting this on or off sets all children. Setting to True sets all the parents active too.

autoCalcMotionContactResolution : Bool

Returns or sets the motion contact fidelity properties from the part.

autoCalculateCG : Bool

Determines whether the center of gravity is auto calculated.

autoCalculateMass : Bool

Determines whether the mass value is automatically calculated based upon volume and material density.

autoCalculateMeshSize : Bool

Indicates whether the minimum and average element sizes used for the solution are automatically calculated.

Set to False to enter these values manually.

Decreasing the minimum element size will increase the detail of your results in areas that use a number of small elements. The average element size controls the overall detail of your results.

autoCalculateMoment : Bool

Determines whether the mass moment of inertia is automatically calculated.

autoCalculateThickness : Bool

Determines whether the minimum and maximum thickness values are automatically calculated.

All parts are taken into account during the calculation.

cg : Location (units=”length”)

Returns the object’s global center of gravity as a point.

color : Color

Determines the color assigned to the object when it is displayed in the modeling window.

The default color for parts is gray, but a different color can be assigned.

designSpace : Bool

Determines whether the part is a design space.

A part must be designated as a design space if we intend to optimize it.

detectCollisions : Bool

Determines whether to detect collision.

It prevents parts in the model from overlapping and has been enabled by default.

flexible : Bool

Makes the part flexible, if set to True.

ground : Bool

Returns or sets the object to be ground or immovable.

ignoreFlexibility : Bool

Allows the part to ignore flexibility.

ip : Inertia (units=”massMI”)

Specifies the inertial properties of this object.

Resistance to change in motion (ixx, iyy, izz, ixy, izy, ixz).

mass : Double (units=”m”)

The mass of the object.

material : Attribute

The material of the object.

Every part in the model has a material assigned to it. The default material is steel, but a different material can be assigned.

maxFreq : Double (units=”frequency”)

Upper bound frequency for the eigenvalue analysis of the flexible part.

maxMeshSize : Double (units=”length”)

Returns or sets the maximum mesh size of the part.

maxThickness : Double (units=”length”)

The maximum thickness value.

minGap : Double (units=”length”)

minMeshSize : Double (units=”length”)

Returns or sets the minimum mesh size of the part.

minThickness : Double (units=”length”)

The minimum thickness value.

modeType : Enum

How normal modes are defined.

modifiable : Bool

Determines whether the selected object can be edited.

morphable : Bool

Determines whether the selected object shape can be changed.

motionContactResolution : Enum (verylow, low, medium, high, veryhigh)

The resolution of the motion contact. It can be:

  • “verylow”

  • “low”

  • “medium”

  • “high”

  • “veryhigh”

movable : Bool

Determines whether the selected object can be translated in the modeling window or has been locked in place.

name : Attribute

Returns or sets the name of the object.

It can be any text string, including spaces, although it’s best to avoid using the following characters: ” ‘ * ? and $.

While these characters are allowed, they could create difficulties when you export the model to other applications.

numModes : Int

Specifies the number of modes of the part.

orderType : Enum

Order of elements for flexbody mesh.

position : Attribute

Specifies the global transform as a Matrix44.

rigidGroup : Attribute

The rigid group this object belongs to.

sheetThickness : Double (units=”length”)

Thickness of the 2D part used in volume calculation.

strainCalculation : Bool

Determines whether to calculate the strain or not.

stressCalculation : Bool

Determines whether to calculate stress or not.

transparency : Double

Specifies the transparency of the object.

Allows you to change the transparency, according to a percentage. By default, objects are 0% transparent(opaque).

visible : Bool

Determines whether the object is visible in the graphics window.

Setting this on or off sets all children. Setting to True sets all the parents visible too.

volume : Double (units=”volume”)

The volume of the object in the assembly.

Method Details

classmethod create2DSurface(cls, numberRowsOfFaces=1, numberColumnOfFaces=1, cornerVertices=[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]], parent=None)

Creates a PolyNURBS surface in space.

param numberRowsOfFaces

Number of faces to be shown vertically for the surface.

type numberRowsOfFaces

int

param numberColumnOfFaces

Number of faces to be shown horizontally for the surface.

type numberColumnOfFaces

int

param cornerVertices

The four corner vertices location in global space.

type cornerVertices

list[math.Point, math.Point, math.Point, math.Point]

param parent

The parent of the new part created.

type parent

Assembly

returns

PolyNURBS

classmethod createBrick(cls, x=1, y=1, z=1, position=None, parent=None)

Creates a PolyNURBS block in space.

param x

Length of the block.

type x

float

param y

Width of the block.

type y

float

param z

Depth of the block.

type z

float

param position

Transformation matrix of the block.

type position

math.Matrix44

param parent

The parent of the new part created.

type parent

Assembly

returns

PolyNURBS

classmethod createCustomPolygon(cls, vertices, indices, edgeWeights=None, parent=None)

Creates a custom PolyNURBs polygon.

param vertices

List of each vertex location in global space.

type vertices

list[math.Point]

param indices

List of vertex indices forming each polygon.

type indices

list[list[int]]

param edgeWeights

A list of list containing vertex 1 index, vertex 2 index and the weight. The weight should be in [0, 10], with 10 being perfect crease with the cage. Edge weights pull the smooth surface closer to the cage’s edge.

type edgeWeights

list[list[int, int, float]]

param parent

The parent of the new part created.

type parent

Assembly

returns

PolyNURBS

classmethod createPolygonMesh(cls, vertices, indices, edgeWeights=None, parent=None)

Creates a custom PolyNURBs polygon.

param vertices

List of each vertex location in global space.

type vertices

list[math.Point]

param indices

List of vertex indices forming each polygon.

type indices

list[list[int]]

param edgeWeights

A list of list containing vertex 1 index, vertex 2 index and the weight. The weight should be in [0, 10], with 10 being perfect crease with the cage. Edge weights pull the smooth surface closer to the cage’s edge.

type edgeWeights

list[list[int, int, float]]

param parent

The parent of the new part created.

type parent

Assembly

returns

PolyNURBS

classmethod createSurfaceGrid(cls, numberRowsOfFaces=1, numberColumnOfFaces=1, cornerVertices=[[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]], parent=None)

Creates a PolyNURBS surface in space.

param numberRowsOfFaces

Number of faces to be shown vertically for the surface.

type numberRowsOfFaces

int

param numberColumnOfFaces

Number of faces to be shown horizontally for the surface.

type numberColumnOfFaces

int

param cornerVertices

The four corner vertices location in global space.

type cornerVertices

list[math.Point, math.Point, math.Point, math.Point]

param parent

The parent of the new part created.

type parent

Assembly

returns

PolyNURBS

classmethod fit(cls, parts, numberOfFaces=500, curvature=0.5, autoCrease=False, system=None, symmetry=(0, 0, 0), parent=None)

Creates a new PolyNURBS part, on top of an existing mesh geometry.

param parts

The parts to be fitted. If you pass more than one part, they will be combined into a single part.

type parts

list[Part]

param numberOfFaces

The number of PolyNURBS cage faces to be created for each part.

type numberOfFaces

int

param curvature

The amount of curvature detail to be captured. The value should range between 0 and 1. Higher values will capture more features.

type curvature

float

param autoCrease

If True, the Fit operation will attempt to retain sharp edges from the original model, so you can create fillets at a later time.

type autoCrease

bool

param system

Reference system which symmetry should occur about.

type system

System

param symmetry

Specifies the direction of the symmetry along which axis of the system. The value can be (0,1,0) specifying the symmetry along Y axis of the reference system.

type symmetry

math.Vector

param parent

The parent of the new part created.

type parent

Assembly

returns

PolyNURBS

classmethod fitSynthesis(cls, synthesis, curvature=50, numberOfFaces=2500, shrinkWrapSize=0.0019, autoCrease=False, intersect=True, symmetry=True, density=None)

Fits an optimized part with PolyNURBS

param synthesis

Synthesis object to get the synthesized part

type synthesis

Synthesis

param curvature

The amount of curvature detail to be captured. The value must be between 0 and 100. Higher values capture more features.

type curvature

float

param numberOfFaces

The number of PolyNURBs cage faces to be created for each optimized part.

type numberOfFaces

int

param shrinkWrapSize

The Voxel dimension size for each PolyNURB cage.

type shrinkWrapSize

float

param autoCrease

If True, the Fit operation will attempt to retain sharp edges from the original model, so you can create fillets at a later time.

type autoCrease

bool

param intersect

If True, intersects the optimized part with the new PolyNURBS part.

type intersect

bool

param symmetry

If True, align the optimized part with symmetric constraints.

type symmetry

bool

param density

Density Threshold Value.Value can range from 0 to 1.0.

type density

float

bridge(self, faces)

Bridge tool to create a bridge between two or more faces of either the same PolyNURBS cage or different cages.

param faces

The faces to create bridge.

type faces

list[FeatureArea]

closeHolesInSolid(self)

Closes holes of the given part.

edit(self)

Contextmanager to group multiple updates for performance.

findAndFixBadFaces(self)

Finds and fixes any bad faces of the given part.

getFeatures(self, type=None, rep='PolymeshRep', **kwds)

Returns a list of features based on specified filters.

mirror(self, areas, origin, normal, keepOriginal=True)

Tool to mirror PolyNURBS bodies across a symmetry plane.

param areas

The faces to create mirror.

type areas

list[FeatureArea]

param origin

The origin of the mirror.

type origin

math.Point

param normal

The normal of the mirror.

type normal

math.Vector

param keepOriginal

If True, both the original and the mirrored bodies will be retained in the model.

type keepOriginal

bool

moveEdge(self, edge, direction, distance)

Move the edge according to direction and distance.

param edge

Face to be moved.

type edge

FeatureLinear

param direction

Direction in which face to be moved.

type direction

math.Vector

param distance

The distance by which face need to be moved.

type distance

float

moveFace(self, face, direction, distance)

Move the face according to direction and distance.

param face

Face to be moved.

type face

FeatureArea

param direction

Direction in which face to be moved.

type direction

math.Vector

param distance

The distance by which face need to be moved.

type distance

float

movePoints(self, deltaLocations)

Translates the points according to translation deltas given.

param deltaLocations

A mapping of points to their corresponding (dx, dy, dz) translation.

type deltaLocations

dict[FeaturePoint, math.Point]

setPointLocations(self, locations)

Moves points to an exact location.

param locations

A mapping of points to the corresponding new location.

type locations

dict[FeaturePoint, math.Point]

sharpen(self, edge, weight)

Controls sharpness along an edge of the part.

param edge

Edge to sharpen.

type edge

FeatureCurve

param weight

Weight to sharpen edge with.

type weight

float

shell(self, areas, thickness=0)

Removes the cage face and creates thin walls to generate a shelled PolyNURBS part.

param areas

The cage faces to remove.

type areas

list[FeatureArea]

param thickness

The wall thickness of the shelled PolyNURBS part. If invalid thickness, is passed in, it will be computed.

type thickness

float

splitArea(self, area, point1, point2)

Splits a single PolyNURBS cage face.

Divides the area into two, including the original face, with a new edge between the original and new face. The order of points determines which resulting face is the original and which is new.

param area

The area to divide.

type area

FeatureArea

param point1

The first point of the edge.

type point1

FeaturePoint

param point2

The second point of the edge.

type point2

FeaturePoint