Download this example

Download this example as a Jupyter Notebook or as a Python script.


Modeling: Chamfer edges and faces#

A chamfer is an angled cut on an edge. Chamfers can be created using the Modeler.geometry_commands module.

Create a block#

Launch the modeler and create a block.

[1]:
from ansys.geometry.core import launch_modeler, Modeler

modeler = Modeler()
print(modeler)
Ansys Geometry Modeler (0x20373182f30)

Ansys Geometry Modeler Client (0x2037302d820)
  Target:     127.0.0.1:700
  Connection: Healthy
[2]:
from ansys.geometry.core.sketch import Sketch
from ansys.geometry.core.math import Point2D

design = modeler.create_design("chamfer_block")
body = design.extrude_sketch("block", Sketch().box(Point2D([0, 0]), 1, 1), 1)

body.plot()

Chamfer edges#

Create a uniform chamfer on all edges of the block.

[3]:
modeler.geometry_commands.chamfer(body.edges, distance=0.1)

body.plot()

Chamfer faces#

The chamfer of a face can also be modified. Create a chamfer on a single edge and then modify the chamfer distance value by providing the newly created face that represents the chamfer.

[4]:
body = design.extrude_sketch("box", Sketch().box(Point2D([0,0]), 1, 1), 1)

modeler.geometry_commands.chamfer(body.edges[0], distance=0.1)

body.plot()
[5]:
modeler.geometry_commands.chamfer(body.faces[-1], distance=0.3)

body.plot()

Download this example

Download this example as a Jupyter Notebook or as a Python script.