2013-02-12 20:37:44 +06:00
|
|
|
# Smoothing
|
|
|
|
|
2022-04-13 12:01:14 +05:00
|
|
|
from mechanic import *
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# select the top face
|
2022-04-13 12:01:14 +05:00
|
|
|
faces = geom_builder.SubShapeAllSorted(mechanic, geom_builder.ShapeType["FACE"])
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a group of faces to be smoothed
|
2022-04-13 12:01:14 +05:00
|
|
|
group_smooth = mesh.GroupOnGeom(faces[3], "Group of faces (smooth)", SMESH.FACE)
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# perform smoothing
|
|
|
|
|
|
|
|
# boolean SmoothObject(Object, IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)
|
2022-04-13 12:01:14 +05:00
|
|
|
res = mesh.SmoothObject(group_smooth, [], 20, 2., smesh_builder.CENTROIDAL_SMOOTH)
|
2017-03-20 17:27:30 +05:00
|
|
|
print("\nSmoothing ... ", end=' ')
|
|
|
|
if not res: print("failed!")
|
|
|
|
else: print("done.")
|