=========== Operations_ =========== pushPull ======== .. autofunction:: hwx.inspire.core.geometry.pushPull **Example** .. code-block:: from hwx import inspire model = inspire.newModel() cylinder1 = model.createSolidCylinder( radius=1, height=6, ) cylinder1.location = (-4, 0, 0) parts = model.parts featPlanar = parts[0].getFeatures(type='FeaturePlanar')[1] featPlanar.pushPull('1m') inspire.fitView() print("Cylinder1 is pushed to 1 meter without using variable.") inspire.orientView(direction="isometric") # Usage of variable to pushPull a feature. cylinder2 = model.createSolidCylinder( radius=1, height=6, ) parts = model.parts featPlanar = parts[0].getFeatures(type='FeaturePlanar')[1] model.variables.add("depth", type="length", expression=0.8) featPlanar.pushPull("depth") inspire.fitView() print("Cylinder2 is pushed to 1 meter by using variable 'depth'.") inspire.orientView(direction="isometric") # Example to edit pushPull operation. pushPullCF = model.construction[-1] with pushPullCF.edit(): pushPullCF.depth = 3 inspire.fitView() print("Cylinder2 is pushed to 3 meter by editing cf.") inspire.orientView(direction="isometric") extract ======= .. autofunction:: hwx.inspire.core.geometry.extract **Example** .. code-block:: from hwx import inspire model = inspire.openTutorialFile("Structures/base.x_t") parts=model.parts featPlanar=model.parts[0].getFeatures(type='FeaturePlanar')[8] featPlanar.extract() print("Extracted part is created") inspire.orientView(direction="isometric") mirror ====== .. autofunction:: hwx.inspire.core.geometry.mirror **Example** .. code-block:: # There are two ways, user can create a mirrored part. One by calling # mirror method on the part, or else select a planar feature on which # the mirrored part will be created from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() # First using the part box.mirror(planeOrigin=(0, 0, 1), planeNormal=(0, 0, 1)) print("A new part has been mirrored") featurePlanar = box.getFeatures(type='FeaturePlanar')[1] featurePlanar.mirror() print("Another new part has been mirrored from the planar feature") inspire.orientView(direction="isometric") patch ===== .. autofunction:: hwx.inspire.core.geometry.patch **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() cyl = model.createSolidCylinder(radius=0.3) part = box.booleanSubtract(cyl) featCircular = part.getFeatures(type='FeatureCircular')[0] featCircular.patch() print("Patch is created on a cylindrical face ") featPlanar = part.getFeatures(type='FeaturePlanar')[2] featPlanar.deleteFaces() print("Deleted a planar face from the part ") inspire.orientView(direction="isometric") rotate ====== .. autofunction:: hwx.inspire.core.geometry.rotate **Example** .. code-block:: from hwx import inspire model = inspire.newModel() cylinder1 = model.createSolidCylinder( radius=1, height=6, color='blue' ) cylinder2 = model.createSolidCylinder( radius=1, height=6, color='red' ) cylinder2.rotate('x', 45, degrees=True) inspire.fitView() translate ========= .. autofunction:: hwx.inspire.core.geometry.translate **Example** .. code-block:: from hwx import inspire model = inspire.newModel() cylinder1 = model.createSolidCylinder( radius=1, height=6, color='blue' ) cylinder2 = model.createSolidCylinder( radius=1, height=6, color='red' ) cylinder2.translate(x=10, y=0, z=0) inspire.fitView() move ==== .. autofunction:: hwx.inspire.core.geometry.move **Example** .. code-block:: from hwx import inspire from hwx.common.math import Matrix44 model = inspire.newModel() cylinder1 = model.createSolidCylinder( radius=1, height=6, color='blue' ) cylinder2 = model.createSolidCylinder( radius=1, height=6, color='red' ) mat = Matrix44(origin=[1, 2, 3], angles=[30, 0, 0], degrees=True) cylinder2.move(mat) inspire.fitView() deleteFaces =========== .. autofunction:: hwx.inspire.core.geometry.deleteFaces scale ===== .. autofunction:: hwx.inspire.core.geometry.scale **Example** .. code-block:: from hwx import inspire model=inspire.openTutorialFile("Structures/plate.x_t") part=model.parts[0] part.scale(2.0) print("Part is scaled by factor 2") inspire.fitView() booleanCombine ============== .. autofunction:: hwx.inspire.core.geometry.booleanCombine **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() sphere = model.createSolidSphere() box.booleanCombine(sphere) print("Box is combined with sphere") inspire.orientView(direction="isometric") booleanSubtract =============== .. autofunction:: hwx.inspire.core.geometry.booleanSubtract **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() sphere = model.createSolidSphere() sphere.booleanSubtract(box) print("Sphere is subtracted with box") inspire.orientView(direction="isometric") booleanIntersect ================ .. autofunction:: hwx.inspire.core.geometry.booleanIntersect **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() sphere = model.createSolidSphere() sphere.booleanIntersect(box) print("Sphere is intersected with box") inspire.orientView(direction="isometric") slice ===== .. autofunction:: hwx.inspire.core.geometry.slice **Example** .. code-block:: # There are two ways, user can create a slice part. One by calling # slice method on the part with cutNormal & cutOrigion and other by calling # slice method with surfaceFeature to slice out on surface mode. from hwx import inspire model = inspire.newModel() part = model.createSolidBlock(x=2, y=1, z=1, location=(0, 0, 0)) history = model.history # First using the Plane Slice part.slice(cutOrigin=(0,0,0), cutNormal=(1,0,0)) print("A new part has been sliced out from the existing part on Plane Mode " "with both cutNormal and cutOrigin") # Second using the Surface Slice box = model.createSolidBlock(location=(-1, 0.5, 0)) feature = box.features[21] part.slice(surfaceFeature=feature, extendSurface=True) history.noteState() print("Another new part has been sliced out from the existing part on Surface Mode") inspire.orientView(direction="isometric") simplifyImprints ================ .. autofunction:: hwx.inspire.core.geometry.simplifyImprints **Example** .. code-block:: # There are two ways, user can remove an imprint from model. One by calling # simplifyImprints on the imprint feature or choose the part from which you # want to remove the imprints from. from hwx import inspire from hwx.inspire.demo import openDemoFile model = openDemoFile("Imprints.x_t") linearFeatures = model.getFeatures(type='FeatureLinear') # Removing Imprint feature linearFeatures[0].simplifyImprints() print("A line imprint has been removed from the part") # Removing Imprints from a part model.parts[0].simplifyImprints() print("All the line imprints has been removed from the part") inspire.orientView(direction="isometric") simplifyRounds ============== .. autofunction:: hwx.inspire.core.geometry.simplifyRounds **Example** .. code-block:: # There are two ways, user can remove a round or fillets from model. One by calling # simplifyRounds on the feature or choose the part from which you # want to remove the rounds from. from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() feats = box.getFeatures(type='FeatureLinear')[:4] inspire.geometry.edgeFillet(feats, radius='60mm') featCylindrical = model.parts[0].getFeatures(type='FeatureCylindrical')[3] # Removing the fillet feature featCylindrical.simplifyRounds() print("A Fillet has been removed from the part.") # Removing all the fillet features from the part model.parts[0].simplifyRounds() print("All the fillets has been removed from the part.") inspire.orientView(direction="isometric") # Removing all fillet by passing Model. model = inspire.newModel() box2 = model.createSolidBlock() feats2 = box2.getFeatures(type='FeatureLinear')[:4] inspire.geometry.edgeFillet(feats2, radius='60mm') model.simplifyRounds() print("All the fillets has been removed from the model.") inspire.orientView(direction="isometric") simplifyHoles ============= .. autofunction:: hwx.inspire.core.geometry.simplifyHoles **Example** .. code-block:: # There are two ways, user can remove a hole from model. One by calling # simplifyHoles on the hole feature or choose the part from which you # want to remove the holes from. from hwx import inspire model = inspire.openTutorialFile("Structures/bracket.x_t") featCylindrical = model.parts[0].getFeatures(type='FeatureCylindrical')[2] # Removing the hole feature featCylindrical.simplifyHoles() print("A Hole has been removed from the part.") # Removing holes feature from the part model.parts[0].simplifyHoles() print("All the holes has been removed from the part.") inspire.orientView(direction="isometric") simplifyPlugs ============= .. autofunction:: hwx.inspire.core.geometry.simplifyPlugs **Example** .. code-block:: # There are two ways, user can plug holes from model. One by calling # simplifyPlugs on the hole feature or choose the part from which you # want to plug the holes from. from hwx import inspire model = inspire.openTutorialFile("Structures/bracket.x_t") featCylindrical = model.parts[0].getFeatures(type='FeatureCylindrical')[2] # Plug the hole feature featCylindrical.simplifyPlugs() print("A Hole has been plugged with new part.") # Plug all the holes in the part model.parts[0].simplifyPlugs() print("All the holes has been with new part.") inspire.orientView(direction="isometric") partition ========= .. autofunction:: hwx.inspire.core.geometry.partition **Example** .. code-block:: from hwx import inspire model = inspire.openTutorialFile("Structures/bracket.x_t") featCircular = model.parts[0].getFeatures(type='FeatureCylindrical')[2] featCircular.partition(thickness="3 mm") print("Partition part is created with thickness of 3mm") inspire.orientView(direction="isometric") midSurface ========== .. autofunction:: hwx.inspire.core.geometry.midSurface **Example** .. code-block:: from hwx import inspire model = inspire.newModel() part = model.createSolidBlock() part.midSurface(surfaceOptions='Left') print("A Surface has been extracted from part {0}", part) inspire.orientView(direction="isometric") chamferByAngle ============== .. autofunction:: hwx.inspire.core.geometry.chamferByAngle **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() featPlane1, featPlane2 = box.getFeatures(type='FeaturePlanar')[0:2] # Chamfer by angle featPlane1.chamferByAngle(angle=45, dist=0.05) print("New chamfers is created.") inspire.orientView(direction="isometric") chamferByDistance ================= .. autofunction:: hwx.inspire.core.geometry.chamferByDistance **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() featPlane1, featPlane2 = box.getFeatures(type='FeaturePlanar')[0:2] # Chamfer by distance featPlane2.chamferByDistance(dist1=0.06, dist2=0.06) print("New chamfer is created.") inspire.orientView(direction="isometric") shell ===== .. autofunction:: hwx.inspire.core.geometry.shell **Example** .. code-block:: from hwx import inspire model = inspire.openTutorialFile("Structures/base.x_t") parts=model.parts featPlanar=model.parts[0].getFeatures(type='FeaturePlanar')[9] featPlanar.shell(thickness=.5) print("Shell is created on base part with the thickness of 0.5mm") inspire.orientView(direction="isometric") extrude ======= .. autofunction:: hwx.inspire.core.geometry.extrude **Example** .. code-block:: from hwx import inspire # Extrude As Solid model = inspire.newModel() s = inspire.core.Sketch() s.addRectangle2Vertex((0, 0), (2, 2)) s.realize() sketch_part = model.getAllChildren('SketchPart')[0] inspire.geometry.extrude(sketch_part.getFeatures(type=inspire.FeatureArea), "SINGLE", "NEW_PART", extrudeTo1=0.1) s = inspire.core.Sketch() s.addCircleCenterRadius((1, 1), 0.3) s.realize() sketch_part = model.getAllChildren('SketchPart')[1] sketch_part.position p = model.parts[0] faces = p.getFeatures('FeaturePlanar') inspire.geometry.extrude(sketch_part.getFeatures(type=inspire.FeatureArea), "SINGLE", "SUBTRACT", extrudeTo1=faces[4]) # Extrude As Sheet s = inspire.core.Sketch() s.addRectangle2Vertex((0, 0), (2, 2)) s.realize() sketch_part = model.getAllChildren('SketchPart')[0] inspire.geometry.extrude(sketch_part.getFeatures(type=inspire.FeatureArea), "SYMMETRY", "NEW_PART", extrudeTo1=0.1, angle1=45, extrudeAsSolid=False, reference=(0, 0, 1), extrusionEndCaps="BOTH") inspire.orientView(direction="isometric") offset ====== .. autofunction:: hwx.inspire.core.geometry.offset **Example** .. code-block:: from hwx import inspire # Creating a solid box and applying offset of value 3.0 in face feature and value 0.2 to part model = inspire.newModel() box = model.createSolidBlock() featFace = box.getFeatures(type="FeaturePlanar") inspire.core.geometry.offset(featFace, value=3.0) inspire.core.geometry.offset(box, value=0.2) print("Offset has been applied to feature and part") inspire.orientView(direction="isometric") thicken ======= .. autofunction:: hwx.inspire.core.geometry.thicken **Example** .. code-block:: from hwx import inspire # Creating a solid box and applying thicken of value 0.2 model = inspire.newModel() box = model.createSolidBlock() inspire.core.geometry.thicken(box, value=0.2) print("Thicken has been applied to a part") inspire.orientView(direction="isometric") linearPattern ============= .. autofunction:: hwx.inspire.core.geometry.linearPattern **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() # Creating a linear pattern of box. box.linearPattern(direction1=box.getFeatures(type="FeatureCurve")[0], spacing1=2, count1=5, symmetry1=True) print("Linear pattern has been created for Box") inspire.orientView(direction="isometric") createPipe ========== .. autofunction:: hwx.inspire.core.geometry.createPipe **Example** .. code-block:: from hwx import inspire # Creating a sketch of line segment. model = inspire.newModel() s = inspire.core.Sketch() point1 = s.addPoint(0, 0) start = s.addPoint(0, 5) s.addLineSegment(point1, start) s.realize() sketch_part = model.getAllChildren(inspire.SketchPart)[0] features = sketch_part.getFeatures(type=inspire.FeatureLinear) # Creating a circular pipe. inspire.core.geometry.createPipe(features, section="CIRCLE", resultType="NEW_PART", thickness=1, size=5) print("Circular Pipe has been created for given feature path") inspire.orientView(direction="isometric") moveFaces ========= .. autofunction:: hwx.inspire.core.geometry.moveFaces **Example** .. code-block:: from hwx import inspire # Creating a solid block with a hole in it. model = inspire.newModel() box = model.createSolidBlock() cyl = model.createSolidCylinder(radius=0.03) part = box.booleanSubtract(cyl) part.location = (0, 0, 0) feature = model.getFeatures(type="FeatureCylindrical")[0] location1 = inspire.math.Matrix44(origin=[0.31, 0.30, 1]) # Moving hole to other location inspire.geometry.moveFaces(feature, location1) print("Hole is moved from origin to location1 in solid box") inspire.orientView(direction="isometric") intersect ========= .. autofunction:: hwx.inspire.core.geometry.intersect **Example** .. code-block:: from hwx import inspire # Creating a model to show intersect tool. model = inspire.newModel() part1 = model.createSheetPolygon(radius=3) part2 = model.createSheetRectangle(x=4, y=2) part3 = model.createSolidCylinder() # Intersecting all part from model inspire.geometry.intersect([part1, part2, part3], createSolids=True) print("All parts in a model are intersected and a new part is created") inspire.orientView(direction="isometric") convertToMass ============= .. autofunction:: hwx.inspire.core.geometry.convertToMass **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() cyl = model.createSolidCylinder() sph = model.createSolidSphere() # Replace part with ConcentratedMass cm1 = box.convertToMass() # Replace multiple parts with ConcentratedMass cm2 = inspire.geometry.convertToMass([cyl, sph]) print("Parts have been replaced with concentrated masses : ", cm1, cm2) inspire.orientView(direction="isometric") replaceFromFile =============== .. autofunction:: hwx.inspire.core.geometry.replaceFromFile **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() filePath = str(inspire.demo.getDemoFilePath('M01_FourBar.x_b')) part = inspire.geometry.replaceFromFile(box, filePath) print("Box is replaced with the file: M01_FourBar.x_b") inspire.orientView(direction="isometric") replaceFromPart =============== .. autofunction:: hwx.inspire.core.geometry.replaceFromPart **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock(x=2, y=2, z=0.5) cyl = model.createSolidCylinder() inspire.geometry.replaceFromPart(box, cyl) print("Box is replaced with Cylinder") inspire.orientView(direction="isometric") circularPattern =============== .. autofunction:: hwx.inspire.core.geometry.circularPattern **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() feature = model.getFeatures(type="FeatureLinear")[0] # Creating a circular pattern of box. box.circularPattern(axis=feature, angle=60, count=6, symmetry=True) print("Circular pattern has been created for Box") inspire.orientView(direction="isometric") draft ===== .. autofunction:: hwx.inspire.core.geometry.draft **Example** .. code-block:: from hwx import inspire model = inspire.newModel() model.createSolidBlock(x=0.01, y=0.01, z=0.08) feature = model.getFeatures(type="FeaturePlanar")[1] neutralPlane = model.getFeatures(type="FeaturePlanar")[0] # Creating a draft in Single direction with 20-degree angle. feature.draft("SINGLE", neutralPlane, angle1=20) print("Draft has been created in single direction with 20 degree angle") inspire.orientView(direction="isometric") convertBodiesToParts ==================== .. autofunction:: hwx.inspire.core.geometry.convertBodiesToParts **Example** .. code-block:: from hwx import inspire model = inspire.newModel() model.createSolidBlock() features = model.getFeatures(type="FeaturePlanar") m1 = inspire.math.Matrix44(origin=[3, 0, 0]) inspire.geometry.moveFaces(features, m1, duplicate=True) parts = inspire.geometry.convertBodiesToParts(model.parts[0]) print(" Converted Parts: ", parts) inspire.orientView(direction="isometric") breakInstance ============= .. autofunction:: hwx.inspire.core.geometry.breakInstance **Example** .. code-block:: from hwx import inspire from hwx.inspire.demo import openDemoFile model = openDemoFile("BreakInstance.stmod") inspire.geometry.breakInstance([model.parts[0], model.parts[1]]) print("Break Instance has been applied to both parts.") inspire.orientView(direction="isometric") trimAndSplit ============ .. autofunction:: hwx.inspire.core.geometry.trimAndSplit **Example** .. code-block:: from hwx import inspire # Creating a model to show project and split tool. model = inspire.newModel() part = model.createSolidBlock(x=2, y=1, z=1, location=(0, 0, 0)) box = model.createSolidBlock(location=(-1, 0.5, 0)) feature = box.features[21] part.slice(surfaceFeature=feature, extendSurface=False) part.slice(surfaceFeature=feature, extendSurface=True) tool = model.getFeatures(type="FeatureLinear")[31] target = model.parts[1] inspire.core.geometry.trimAndSplit(target, tool, "Y", trim=False) print("A linear feature has been projected on part and also divided it " "into two parts") inspire.orientView(direction="isometric") revolve2 ======== .. autofunction:: hwx.inspire.core.geometry.revolve2 **Example** .. code-block:: from hwx import inspire model = inspire.newModel() rectangle = model.createSheetRectangle() feat = rectangle.getFeatures(inspire.FeaturePlanar)[0] feat2 = rectangle.getFeatures(inspire.FeatureLinear)[2] inspire.geometry.revolve2(feat, feat2, "SINGLE", "NEW_PART", angle1=200) print("Rectangular sheet has been revolved on linear axis for 200 degree") inspire.fitView() edgeFillet ========== .. autofunction:: hwx.inspire.core.geometry.edgeFillet **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() edge = box.getFeatures(type='FeatureLinear')[0] edge.edgeFillet(radius='60mm') print('Fillet is created on a edge with radius "60mm"') inspire.orientView(direction="isometric") sweep ===== .. autofunction:: hwx.inspire.core.geometry.sweep **Example** .. code-block:: from hwx import inspire model = inspire.newModel() sketch1 = inspire.Sketch() sketch1.addRegularPolygon((0, 0), (1, 0), 7) sketch2 = inspire.Sketch("Global Y") sketch2.addLineSegment((0, -2), (0, 5)) sketch2.realize() sketch1.realize() sks = model.sketches path = sks[0].getFeatures(inspire.core.FeatureCurve) profile = sks[1].getFeatures(inspire.core.FeatureArea) inspire.geometry.sweep(profile, path, pathDirection="BOTH", twistType="NO_OF_TURNS", twistTurns=1, twistTurnsDir2=2, resultType="NEW_PART") print("Sweep has been created in both direction of profile.") inspire.orientView(direction="isometric") nurbsCurve ========== .. autofunction:: hwx.inspire.core.geometry.nurbsCurve **Example** .. code-block:: from hwx import inspire model = inspire.newModel() model.createSolidBlock() point1 = model.getFeatures(type="FeaturePoint")[0] point2 = model.getFeatures(type="FeaturePoint")[1] point3 = model.getFeatures(type="FeaturePoint")[3] inspire.geometry.nurbsCurve([point1, point2, point3]) print("NURBS Curve has been created with given control points.") inspire.orientView(direction="isometric") patternAlongPath ================ .. autofunction:: hwx.inspire.core.geometry.patternAlongPath **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() path = box.getFeatures(type=inspire.FeatureCurve)[0] # Creating a box pattern along the path. box.patternAlongPath(path=path, count=3, spacing=1) print("Pattern along the path has been created for Box") inspire.orientView(direction="isometric") multiSweep ========== .. autofunction:: hwx.inspire.core.geometry.multiSweep **Example** .. code-block:: from hwx import inspire model = inspire.newModel() model.createSolidBlock(z=2) feature = model.getFeatures(type=inspire.FeaturePlanar)[0] inspire.geometry.Plane(feature, "OFFSET", offset=0.05) systems = model.getAllChildren(type=inspire.geometry.Plane)[-1] sketch1 = inspire.Sketch() sketch3 = inspire.Sketch(systems) sketch1.addRegularPolygon((0, 0), (1, 0), 7) sketch3.addRegularPolygon((0, 0), (1, 1), 7) sketch2 = inspire.Sketch("Global Y") sketch2.addLineSegment((0, -3), (0, 1)) sketch2.realize() sketch1.realize() sketch3.realize() sks = model.sketches path = sks[0].getFeatures(inspire.core.FeatureCurve) profile1 = sks[1].getFeatures(inspire.core.FeatureArea)[0] profile2 = sks[2].getFeatures(inspire.core.FeatureArea)[0] systems.destroy() model.parts[0].destroy() inspire.geometry.multiSweep([profile1, profile2], path, resultType="NEW_PART") print("Multi Sweep has been created with profile1 and profile2.") inspire.orientView(direction="isometric") loft ==== .. autofunction:: hwx.inspire.core.geometry.loft **Example** .. code-block:: from hwx import inspire model = inspire.newModel() model.createSolidBlock(z=2) feature = model.getFeatures(type=inspire.FeaturePlanar)[0] inspire.geometry.Plane(feature, "OFFSET", offset=0.05) systems = model.getAllChildren(type=inspire.geometry.Plane)[-1] sketch1 = inspire.Sketch() sketch3 = inspire.Sketch(systems) sketch1.addRegularPolygon((0, 0), (1, 0), 7) sketch3.addRegularPolygon((0, 0), (1, 1), 7) sketch2 = inspire.Sketch("Global Y") sketch2.addLineSegment((0, -3), (0, 1)) sketch2.realize() sketch1.realize() sketch3.realize() sks = model.sketches path = sks[0].getFeatures(inspire.core.FeatureCurve) profile1 = sks[1].getFeatures(inspire.core.FeatureArea)[0] profile2 = sks[2].getFeatures(inspire.core.FeatureArea)[0] systems.destroy() model.parts[0].destroy() inspire.geometry.loft([profile1, profile2], resultType="NEW_PART") print("Loft has been created with profile1 and profile2.") inspire.orientView(direction="isometric") helixCurve ========== .. autofunction:: hwx.inspire.core.geometry.helixCurve **Example** .. code-block:: from hwx import inspire model = inspire.newModel() sketch1 = inspire.Sketch() sketch1.addCircleCenterRadius((0, 0), 7) sketch1.realize() sks = model.sketches profile = sks[0].getFeatures(inspire.core.FeatureCircular)[0] inspire.geometry.helixCurve(profile, startAngle=30) inspire.fitView() print("Helix Curve has been created with profile.") inspire.orientView(direction="isometric") divideCurve =========== .. autofunction:: hwx.inspire.core.geometry.divideCurve **Example** .. code-block:: from hwx import inspire model = inspire.newModel() sketch1 = inspire.Sketch() sketch1.addCircleCenterRadius((0, 0), 7) sketch1.realize() sks = model.sketches profile = sks[0].getFeatures(inspire.core.FeatureCircular)[0] curve = inspire.geometry.helixCurve(profile, startAngle=10, numTurns=10) inspire.geometry.divideCurve(curve.features[-1], [[0.2, 0.6]]) inspire.fitView() print("Curve has been divided in to 3 parts.") inspire.orientView(direction="isometric") extendCurve =========== .. autofunction:: hwx.inspire.core.geometry.extendCurve **Example** .. code-block:: from hwx import inspire model = inspire.newModel() sketch1 = inspire.Sketch() sketch1.addLineSegment((0, 0), (0, 1)) sketch1.realize() sks = model.sketches curve = sks[0].getFeatures(inspire.core.FeatureLinear)[0] inspire.geometry.extract(curve) curve = model.parts[0].getFeatures(inspire.core.FeatureLinear)[0] inspire.geometry.extendCurve(curve, ["EXTENSION_DISTANCE", 1], extendAsNewPart=True) inspire.fitView() print("Part 1 has been extended to Part 2.") inspire.orientView(direction="isometric") blendCurve ========== .. autofunction:: hwx.inspire.core.geometry.blendCurve **Example** .. code-block:: from hwx import inspire from hwx.common import math inspire.newModel() points = [[math.Point(1, 1, 0)], [math.Point(1, 2, 0)]] inspire.geometry.blendCurve(points) inspire.fitView() print("Blend curve has been created between two given points.") inspire.orientView(direction="isometric") faceCurve ========= .. autofunction:: hwx.inspire.core.geometry.faceCurve **Example** .. code-block:: from hwx import inspire model = inspire.newModel() model.createSolidBlock() face = model.getFeatures(type=inspire.FeaturePlanar)[0] vertex = model.getFeatures(type=inspire.FeaturePoint)[0] inspire.geometry.faceCurve(face, vertexFeature=vertex) inspire.fitView() print("Face curves has been extracted from the face of solid block as Part 1" " and Part 2.") inspire.orientView(direction="isometric") offsetCurves ============ .. autofunction:: hwx.inspire.core.geometry.offsetCurves **Example** .. code-block:: from hwx import inspire model = inspire.newModel() sketch1 = inspire.Sketch() sketch1.addLineSegment((0, 0), (0, 0.5)) sketch1.realize() sks = model.sketches curve = sks[0].getFeatures(inspire.core.FeatureLinear)[0] inspire.geometry.extract(curve) curve = model.parts[0].getFeatures(inspire.core.FeatureLinear)[0] inspire.geometry.offsetCurves(curve, 0.02, extensionType="LINEAR", endOptions='CLOSED_AND_ROUNDED', symmetry=True) inspire.fitView() print("Offset Curves has been created for given line.") inspire.orientView(direction="isometric") extendSurface ============= .. autofunction:: hwx.inspire.core.geometry.extendSurface **Example** .. code-block:: from hwx import inspire model = inspire.newModel() rectangleSheet = model.createSheetRectangle() inspire.geometry.extendSurface( rectangleSheet.getFeatures(inspire.core.FeatureLinear), distance=0.3, createNewPart=True) inspire.fitView() print("Extend Surface has been created as a new part around the rectangular" "sheet.") inspire.orientView(direction="isometric") intersectCurve ============== .. autofunction:: hwx.inspire.core.geometry.intersectCurve **Example** .. code-block:: from hwx import inspire model = inspire.newModel() sketch1 = inspire.Sketch() sketch2 = inspire.Sketch() sketch1.addLineSegment((0, -1), (0, 1)) sketch2.addLineSegment((-1, 0), (1, 0)) sketch1.realize() sketch2.realize() sks = model.sketches inspire.geometry.extract(sks[0].getFeatures(inspire.core.FeatureLinear)[0]) inspire.geometry.extract(sks[1].getFeatures(inspire.core.FeatureLinear)[0]) part1 = model.parts[0] part2 = model.parts[1] inspire.geometry.intersectCurve(part1, part2) inspire.fitView() print("Curves are intersected using intersectCurve tool and a new curve " "as a part has been created.") inspire.orientView(direction="isometric") rib === .. autofunction:: hwx.inspire.core.geometry.rib **Example** .. code-block:: from hwx import inspire model = inspire.newModel() box = model.createSolidBlock() featPlane = box.getFeatures(type="FeaturePlanar")[0] featPlane.shell(thickness=0.01) sketch1 = inspire.Sketch("Global Y") sketch1.addLineSegment((0.2, -0.5), (0, -0.5)) sketch1.realize() sks = model.sketches profile = sks[0] inspire.geometry.rib(profile, box, draftAngle=30) inspire.fitView() print("Rib has been created in the shell.") inspire.orientView(direction="isometric") .. toctree:: :maxdepth: 2 Reference_/Reference_.rst