Closed mkofler96 closed 11 months ago
Thanks! Can you add a round-trip test? You can create a separate PR and we can merge both when the test is ready
Did you think of something like this? tests/test_json.py
If yes: should we keep all import/export tests in a single file? Then one could loop over every import/export method, something like
with tempfile.TemporaryDirectory() as tmpd:
tmpf = c.to_tmpf(tmpd)
export_formats = [(c.splinepy.io.json, {"bas64encoding": False}), (c.splinepy.io.iges, {}), (c.splinepy.io.irit, {}) ...]
for (ef, ef_arguments) in export_formats:
ef.export(
tmpf, list_of_splines, **ef_arguments
)
list_of_splines_loaded = ef.load(tmpf)
self.assertTrue(
all(
c.are_splines_equal(a, b)
for a, b in zip(list_of_splines, list_of_splines_loaded)
)
)
What do you think?
Thanks! Can you add a round-trip test? You can create a separate PR and we can merge both when the test is ready
Did you think of something like this? tests/test_json.py
If yes: should we keep all import/export tests in a single file? Then one could loop over every import/export method, something like
with tempfile.TemporaryDirectory() as tmpd: tmpf = c.to_tmpf(tmpd) export_formats = [(c.splinepy.io.json, {"bas64encoding": False}), (c.splinepy.io.iges, {}), (c.splinepy.io.irit, {}) ...] for (ef, ef_arguments) in export_formats: ef.export( tmpf, list_of_splines, **ef_arguments ) list_of_splines_loaded = ef.load(tmpf) self.assertTrue( all( c.are_splines_equal(a, b) for a, b in zip(list_of_splines, list_of_splines_loaded) ) )
What do you think?
yes
Is this still beeing worked on?
Is this still beeing worked on?
yes, I'm still working on the round-trip tests, I just have not found the time for it yet
so turns out BSplineLib will append zeros in case of dim < para_dim and always export 3D splines (maybe this is IGES rule?)
Overview
iges export now checks parametric dimension of spline, if it is 3, then a value error is raised and a suggestion for a solution is presented
Addressed issues
Showcase
calling the example from the issue now gives the following error:
Checklists