compas icon indicating copy to clipboard operation
compas copied to clipboard

Infer precision from first coordinate in OBJ and STL files

Open tetov opened this issue 4 years ago • 2 comments

@brgcode brought up the idea of inferring precision based on first vertex in STL files in issue #360 .

I'm opening this issue to see if that's something that would be beneficial for the file readers. In that case I think we should also do it for OBJ and PLY.

I'll be happy to implement it if people will find it useful.

tetov avatar Oct 18 '19 09:10 tetov

the default precision by which these files are currently processed is the default precision of compas, which is 0.001.

for STL files this is certainly to low. it should be more something like 0.000001.

and in general i think one could assume that the points in a file are distinct up to the precision of the provided number of digits.

so i would vote yes...

tomvanmele avatar Oct 18 '19 11:10 tomvanmele

@brgcode:

for STL files this is certainly to low. it should be more something like 0.000001.

Would the check be like below?

if first_vertex_precision > compas.PRECISION:
    precision = first_vertex_precision

Would it be enough to make sure this is set in the reader or does this require changing compas.PRECISION?

tetov avatar Oct 18 '19 13:10 tetov

@tomvanmele mehh, precision by import seems to invite flaky behaviour another salute to compas.Tolerance

jf--- avatar Apr 06 '24 16:04 jf---

this is indeed not relevant anymore...

tomvanmele avatar Apr 08 '24 17:04 tomvanmele