Dear users,
I am a student who has developed a Feature
Recognition Algorithm which needs to be validated. I intend to use
python occ for this purpose. Any example codes or guidance in the
following areas is much appreciated:
Hi Ganesh,
Canonical feature recognition comes as a paid for add on to OCC:
http://www.opencascade.org/support/products/canrec/
It *surely* would be interesting to see an open source version of such
an algorithm, would be most useful.
Are you thinking of publishing your work on a open source license?
1. determination of surface type(cylinder/sphere/plane/freeform)
from IGES file.
This might help, looks up which GeomAbs type a surface is.
class GeometryLookup():
from OCC import GeomAbs
def __init__(self):
self.lookup, self.reverse_lookup = {}, {}
# construct a geometry types / enum dict
for i in dir(GeomAbs):
if i.startswith('GeomAbs_'):
value = GeomAbs.__dict__[i]
self.lookup[i] = value
self.reverse_lookup[value] = i
def __getitem__(self, face):
from OCC.BRepAdaptor import BRepAdaptor_Surface
try:
return
self.reverse_lookup[ BRepAdaptor_Surface(face).GetType() ]
except KeyError:
print 'failed to lookup geometry type'
return None
usage:
geomLookup = GeometryLookup()
geomLookup[someSurface]
2. determination of edge type(convex/concave/tangent).
check the curvature? occ.geomlprops
3. producing equidistant points on an edge.
from OCC.CPnts import CPnts_AbscissaPoint
4. to find angle between two surfaces on any point that lies on the
edge.
Perhaps look at OCC.ShapeAnalysis?
5. extraction of axis of a cylindrical surface.
6. creation of a cylinder.
from OCC.BRepPrimAPI import BRepPrimAPI_MakeCylinder
Seems to me like you got a really interesting project on your hand
Ganesh.
Cheers,
-jelle
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users