Repository navigation
Conversation
Author
|
@ndem0 : tested on marinAI, works fine @DavideOberto you may want to see and test everything on your end before merging, I thought it would have been better to centralize export functions without rewriting the same code. Should be fine against a few errors that were previously being triggered also on the app I'm working on, which is using BladeX |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Exports were assembled independently in
Blade,PropellerandShaft, each with its own sewing tolerance and its own forced cast toTopoDS_Shell. When the four blade faces do not sew into a single shell (geometry-dependent, e.g. a tip collapsing to a point), that cast raisesStandard_TypeMismatchand the whole export fails. This is a failure triggering an HTTP 500 on IGES exports.This PR moves the B-Rep assembly and the file writing into one module and makes the export path never depend on a boolean fuse or on a closed shell.
bladex/ +├── export.py # compounds, sewing, solid assembly, meshing, writers ├── blade.py # Blade.shell() -> export_stl / export_iges ├── propeller.py # blades_shape() / compound() -> export_stl / export_iges └── shaft/ └── shaft.py # generates its solid through the same helpersGeometry and I/O are now separate:
Changes
New:
bladex/export.pymake_compoundpropeller.pysew_shapesNoneto_solidMakeSolidonly when there is exactly one shell, recursively through nested compounds; returns the sewn shape otherwisemeshis_relativewrite_stlwrite_igesbladex/blade.pyBlade.shell(sewing_tolerance=1e-2): the sewn four faces, used by STL, IGES andgenerate_solid.generate_solid(): tolerance1e-7->1e-2, no blind cast, falls back to the sewn shape.export_stl(): addsangular_deflection(0.3).export_iges(): exports the sewn shell with a tunable tolerance; leading-edge curves unchanged.bladex/propeller.pyblades_shape()andcompound()are public: assembly is geometry, not an export detail.shapeis now the compound;solidis the explicit boolean union, uncached.export_iges()/export_stl()write sewn blades plus the shaft, withinclude_shaftand exposed deflections; no fuse on the default path. STL is always binary.tmp_stl()is a deprecated alias ofexport_stl(include_shaft=False)and emitsDeprecationWarning.display()shows the compound.generate_obj()andgenerate_obj_blades()are repaired: they referencedself.shaft_solid/self.blades_solid(removed in 4f2ffe4) and used fixed/tmp/temp_*.stlpaths. They now usetempfile.TemporaryDirectory.smithersis imported inside the two OBJ methods, soimport bladexno longer requires it.bladex/shaft/shaft.pygenerate_solid()uses the same helpers, removing the same blind shell cast.Packaging
obj = ["smithers[vtk]"].Tests
tests/test_propeller.py:to_solidnested-compound conversion, non-shell shapes left unchanged, binary STL with and without shaft (triangle counts), single-body blade shell, readable propeller IGES, blade IGES with and without leading-edge curves, export surviving unsewable faces,tmp_stlequivalence plus deprecation warning,reflect_bladecontract, OBJ regions for propeller and blades.