PolyNURBS (hwx.inspire.PolyNURBS)#
- class PolyNURBS(x=1, y=1, z=1, position=None, parent=None)#
Bases:
Part
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.
# Name
Type
property
# Name
Description
bridge
(self, faces)Bridge tool to create a bridge between two or more faces of either the
closeHolesInSolid
(self)Closes holes of the given part.
createSurfaceGrid
(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.
createBrick
(x=1, y=1, z=1, position=None, parent=None)Creates a PolyNURBS block in space.
createPolygonMesh
(vertices, indices, edgeWeights=None, parent=None)Creates a custom PolyNURBs polygon.
createPolygonMesh
(vertices, indices, edgeWeights=None, parent=None)Creates a custom PolyNURBs polygon.
createSurfaceGrid
(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.
edit
(self)Contextmanager to group multiple updates for performance.
findAndFixBadFaces
(self)Finds and fixes any bad faces of the given part.
fit
(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.
fitSynthesis
(synthesis, curvature=50, numberOfFaces=2500, shrinkWrapSize=0.0019, autoCrease=False, intersect=True, symmetry=True, density=None)Fits an optimized part with PolyNURBS
getFeatures
(self, type=None, rep=’PolymeshRep’, **kwds)Returns a list of features based on specified filters.
mergeOptions
(self, option)Convert the polyNURBS into a subdivision surface.
mirror
(self, areas, origin, normal, keepOriginal=True)Tool to mirror PolyNURBS bodies across a symmetry plane.
moveEdge
(self, edge, direction, distance)Move the edge according to direction and distance.
moveFace
(self, face, direction, distance)Move the face according to direction and distance.
movePoints
(self, deltaLocations)Translates the points according to translation deltas given.
setPointLocations
(self, locations)Moves points to an exact location.
sharpen
(self, edge, weight)Controls sharpness along an edge of the part.
shell
(self, areas, thickness=0)Removes the cage face and creates thin walls to generate a shelled
splitArea
(self, area, point1, point2)Splits a single PolyNURBS cage face.
Example
from hwx import inspire model = inspire.newModel() # There are two ways to create a PolyNURBS brick primitive # First by creating a PolyNURBS part polynurbPart1 = inspire.PolyNURBS() polynurbPart1.name = "PolyNURBS Brick" inspire.fitView() print("New PolyNURBS part added in the model: ", model.parts[0]) # Second by using the classmethod createBrick polynurbPart2 = inspire.PolyNURBS.createBrick( x=1, y=2, z=3, ) polynurbPart2.location = (1, 0, 0) inspire.fitView() print("New PolyNURBS part added in the model: ", model.parts[1])
- edit()#
Contextmanager to group multiple updates for performance.
- getFeatures(type=None, rep='PolymeshRep', **kwds)#
Returns a list of features based on specified filters.
- findAndFixBadFaces()#
Finds and fixes any bad faces of the given part.
- closeHolesInSolid()#
Closes holes of the given part.
- setPointLocations(locations)#
Moves points to an exact location.
- Parameters:
locations (dict[FeaturePoint, math.Point]) – A mapping of points to the corresponding new location.
- movePoints(deltaLocations)#
Translates the points according to translation deltas given.
- Parameters:
deltaLocations (dict[FeaturePoint, math.Point]) – A mapping of points to their corresponding (dx, dy, dz) translation.
- moveFace(face, direction, distance)#
Move the face according to direction and distance.
- Parameters:
face (FeatureArea) – Face to be moved.
direction (math.Vector) – Direction in which face to be moved.
distance (float) – The distance by which face need to be moved.
- moveEdge(edge, direction, distance)#
Move the edge according to direction and distance.
- Parameters:
edge (FeatureLinear) – Face to be moved.
direction (math.Vector) – Direction in which face to be moved.
distance (float) – The distance by which face need to be moved.
- splitArea(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.
- Parameters:
area (FeatureArea) – The area to divide.
point1 (FeaturePoint) – The first point of the edge.
point2 (FeaturePoint) – The second point of the edge.
- shell(areas, thickness=0)#
Removes the cage face and creates thin walls to generate a shelled PolyNURBS part.
- Parameters:
areas (list[FeatureArea]) – The cage faces to remove.
thickness (float) – The wall thickness of the shelled PolyNURBS part. If invalid thickness, is passed in, it will be computed.
- mirror(areas, origin, normal, keepOriginal=True)#
Tool to mirror PolyNURBS bodies across a symmetry plane.
- Parameters:
areas (list[FeatureArea]) – The faces to create mirror.
origin (math.Point) – The origin of the mirror.
normal (math.Vector) – The normal of the mirror.
keepOriginal (bool) – If True, both the original and the mirrored bodies will be retained in the model.
- bridge(faces)#
Bridge tool to create a bridge between two or more faces of either the same PolyNURBS cage or different cages.
- Parameters:
faces (list[FeatureArea]) – The faces to create bridge.
- sharpen(edge, weight)#
Controls sharpness along an edge of the part.
- Parameters:
edge (FeatureCurve) – Edge to sharpen.
weight (float) – Weight to sharpen edge with.
- property currentRepresentation#
The active representation
- Type:
str
- mergeOptions(option)#
Convert the polyNURBS into a subdivision surface.
- Parameters:
option (str) – Merge options for polyBURBS part. - SUBDIVISION_SURFACE - UNMERGE_SURFACES - MERGE_SURFACES