DynamicType() does not seem to return correct type
mwintzer opened this issue · 0 comments
mwintzer commented
I'm currently working through the canonical "Bottle" exercise as I try to teach myself OCP. I'm stumped at this step, where it appears like the DynamicType() method does not return the expected value:
faceexplorer = TopExp_Explorer(mybody2, TopAbs_FACE)
while faceexplorer.More():
aface = TopoDS.TopoDS.Face_s(faceexplorer.Current())
asurface = BRep_Tool.Surface_s(aface)
# print(asurface.DynamicType().IsInstance(Geom_Plane.get_type_descriptor_s()))
if asurface.DynamicType().IsInstance(Geom_Plane(0,0,0,0).DynamicType()):
print("boo!")
faceexplorer.Next()
I expect the Type to be reported as a Geom_Plane, but the DynamicType() method always return Standard_Type. I'm not approaching this in the way the OCCT docs describe, but for the life of my I could not find the equivalent to the STANDARD_TYPE() macro in the OCP stubs.
Would really appreciate any guidance (whether this is really an issue or if simply PEBKAC). Thanks!