Experimental STEP export#1594
Conversation
|
@ruevs I'm not sure I like the rounding. The approach taken in #1580 did not round arbitrary numbers, it rounded things that were near integer values to integers on the assumption that they were supposed to be integers. In particular we don't want to round weights to less precision when every 90 degree arc has a point with a weight of sqrt(2)/2 for example. |
OK but who is to say that these {0, 0.5, 0.25, 0.75, 1/3, 2/3} are the only numbers that were supposed to be "nice and round"? What if I wanted 1/5, 2/5, 3/5, 4/5 (0.2...0.8)? This is very weird to me. And we do so many numerical calculations down to If fact searching for |
|
We should also keep in mind this https://steptools.com/stds/stp_aim/html/t_uncertainty_measure_with_unit.html In master it is and in this pull request it currently is: I do not know exactly what it does to different programs opening STEP files but it definitely has some relevance. All the "big guns" are discussing it: https://community.ptc.com/t5/3D-Part-Assembly-Design/Is-there-a-way-to-define-accuracy-for-STEP-export/td-p/91286 I'm neither a mechanical engineer nor a STEP expert, but @ilguido chose to set this value to the tolerance he uses for deciding whether two points (and thus line segments, curves, surfaces) are the same (currently |
|
@ruevs It's one thing to specify an accuracy, and another to deliberately round a number to some accuracy. Right? I'm also curious about all those links. There is a whole area of CAD called Geometric Dimensioning and Tolerancing (GDT) which has to do with required accuracy of things when they are machined/manufactured (not how they are stored in a file). It's all outside my experience, but I still don't see a need to round floating point values to lesser precision. GD&T are parameters that can be called out on a drawing, so probably not what's being discussed in those links. |
|
@ilguido I rebased this on current master. |
|
@ruevs We should not apply FP to weights. I'd prefer FP to be more than 5, but regardless I don't think it should be applied to weights. I see you've added a "help wanted" tag I presume to get some input from someone with deeper understanding of STEP? I was really hoping to merge this ;-) |
Oh, now I understood - you don't like it for the
Initially I was going to make it 6 (same as LENGTH_EPS) but then I thought of the possibility of ending up with values like 13.00000099999 that will get rounded to 13.000001... so I went with 5. The errors in the cylinder from #1573 are much smaller, however I have not even tried to figure out if they will be smaller than 4e-7 (so that the rounding to 6 works) in all cases. You are right - I added the "help wanted" hoping someone may shed some light on the UNCERTAINTY_MEASURE_WITH_UNIT value - is it "simply" a default precision/tolerance for the whole model (as in "machine this part to ±0.01mm") or does it somehow interact with the numerical coordinates in the file? At least for Prusa Slicer it seems it does not have anything to do with rounding the numbers - otherwise 0.001 would have been more than enough to round out the 14.99999999999s that are in that file. If this is just a tolerance we should perhaps set it to the " export chord tolerance". |
Sometimes I chain different thoughts together too closely ;-) You're the best ruevs! |
|
I asked to a mechanical designer of ours about the uncertainty in CAD models and he said to me that it is just the tolerance when approximating a mathematical function (e.g. for curved lines or surfaces) through some piecewise linear function (e.g. linear segments, meshes etc.). It matters, as an example, when exporting the model to G-code. |
When exporting STEP files rounding errors sometimes cause problems (#1573). To avoid this round numbers representing point coordinates to five decimal plases when exporting STEP files. Since `LENGTH_EPS = 1e-6` this should be enough to round out errors e.g. 0.999999mm will become 1.00000.
|
I force pushed to remove the rounding from the weights. |
Same as #1589, plus the possibility to use colours to define different volumes. Quick description:
StepFileWriter::exportPartsis the switch to enable the new feature, if false, everything is the same as Export volumes to STEP files #1589;This way, the exported STEP file of an assembly with many parts of different colours should assign a distinct volume to each part.
Please, test this.