Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when converting 00511440.h5 to .step file #29

Open
doralune opened this issue Dec 19, 2024 · 0 comments
Open

Error when converting 00511440.h5 to .step file #29

doralune opened this issue Dec 19, 2024 · 0 comments

Comments

@doralune
Copy link

doralune commented Dec 19, 2024

util/export2step.py becomes error below for 00511440.h5, but fine for 00511440.json

AttributeError: 'NoneType' object has no attribute 'IsNull'

I recreated the h5 file by dataset/json2vec.py, ran util/export2step.py again and got the same error.
Something might have been different when converting from json to h5.

For 00511440.h5, the body in create_CAD() was None after the last step of ['NewBodyFeatureOperation', 'JoinFeatureOperation', 'NewBodyFeatureOperation', 'JoinFeatureOperation'].

def create_CAD(cad_seq: CADSequence):
"""create a 3D CAD model from CADSequence. Only support extrude with boolean operation."""
body = create_by_extrude(cad_seq.seq[0])
for extrude_op in cad_seq.seq[1:]:
new_body = create_by_extrude(extrude_op)
if extrude_op.operation == EXTRUDE_OPERATIONS.index("NewBodyFeatureOperation") or \
extrude_op.operation == EXTRUDE_OPERATIONS.index("JoinFeatureOperation"):
body = BRepAlgoAPI_Fuse(body, new_body).Shape()
elif extrude_op.operation == EXTRUDE_OPERATIONS.index("CutFeatureOperation"):
body = BRepAlgoAPI_Cut(body, new_body).Shape()
elif extrude_op.operation == EXTRUDE_OPERATIONS.index("IntersectFeatureOperation"):
body = BRepAlgoAPI_Common(body, new_body).Shape()
return body

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant