Sketch (hwx.inspire.Sketch)#
- class Sketch(system='Global Z', feature=None, origin=None, normal=None)#
Bases:
Sketch
Inspire version of the core Sketch class. Redefines the initialization to use CFs and has method to convert to an Inspire Part.
Method Table# Name
Description
intersect
(self, input)Extract curves resulting from the intersection of the sketch plane with
project
(self, input)Project selected geometry onto the sketch plane as construction geometry.
realize
(self)Return this sketch as an Inspire Part. This allows to do push/pull on it.
Example
from hwx import inspire from hwx.inspire import Sketch # Start with an empty model model=inspire.newModel() s = Sketch(system="Global Z", feature=None, origin=None, normal=None) r = s.addRectangle2Vertex((0, 0), (2, 2)) c = s.addCircleCenterRadius((1, 1), 0.3) skp = s.realize() skp.features[10].pushPull(2.5) inspire.orientView(direction="isometric")
- realize()#
Return this sketch as an Inspire Part. This allows to do push/pull on it.
Example
from hwx import inspire from hwx.inspire import Sketch # Start with an empty model model=inspire.newModel() s = Sketch(system="Global Z", feature=None, origin=None, normal=None) r = s.addRectangle2Vertex((0, 0), (2, 2)) c = s.addCircleCenterRadius((1, 1), 0.3) skp = s.realize() skp.features[10].pushPull(2.5) inspire.orientView(direction="isometric")
- intersect(input)#
Extract curves resulting from the intersection of the sketch plane with selected parts or surfaces.
- Parameters:
input (list[Parts | FeaturePlanar]) – List of Parts or Features to intersect.
Example
from hwx import inspire # Start with an empty model model = inspire.newModel() block = model.createSolidBlock(x=1, y=1, z=1) block.location = (0, 0, -0.7) sketch = inspire.Sketch(system ="Global Z", feature=None, origin=None, normal=None) sketch.addRectangleCenterVertex((2, 1), (3, 3)) sketch.intersect(block) sketch.realize() inspire.orientView(direction="isometric")
- project(input)#
Project selected geometry onto the sketch plane as construction geometry.
- Parameters:
input (list[Feature]) – List of Features to project on sketch.
Example
from hwx import inspire # Start with an empty model model = inspire.newModel() block = model.createSolidBlock(x=1, y=1, z=1) block.location = (0, 0, 0.5) sketch = inspire.Sketch(system ="Global Z", feature=None, origin=None, normal=None) featPlanar = block.features[-3] sketch.project(featPlanar) sketch_part=sketch.realize() inspire.orientView(direction="isometric")