Obj export and tolerances

Hi, I needed to export the control points, the knots and the polynomial degree of a geometry in order to read them in excel, therefore I exported my geometry using the*obj file.
What I would like to do now is to export the geometry applying a tolerance in order that some points close to each other can be recognized as the same point.
I mean, I have for example two points with coordinates:
0.245693 and 0.245690. What I would like to do is to set the precision to 0.24569 or to merge them in only one point since the two points arise due to a bad modelling. How can I do it?
Thanks a lot in advance.

Hello - you’ll need some scripting for this -

-Pascal

Hi, thank you for your reply.
Do you know if there’s something already existing for doing this using Rhino.Python? I am a beginner on Rhino.Python and unfortunately I have a very tight schedule to export this tricky geometry…

Hello - rereading your comments, are you looking to eliminate duplicate control points in the surface, or only in the exported information? Keep in mind that a surface cannot be recreated from this information by simply leaving out control points, if that is the goal.

-Pascal

I am trying to eliminate duplicate control points only in the exported information without doing it manually.
My geometry is made up of four patches i.e. 4 different surfaces each with its own control points.
These surfaces have in common the edges and even if I made my best to be accurate, some of the control points along the edges of two surfaces are slightly different and when I export them I can see they have different decimals.
What I would like to do is to export each single surface with the *obj function having for the edges the same control points instead of correcting them manually.

Hello - I see - if we can ‘fix’ the surfaces automatically in Rhino, then you use what ever export workflow you are currently using, would that do it?

-Pascal

Yes of course.
If the surfaces in Rhino would perfectly match, then I assume the export through *obj will have no “errors”.

Hello - if you use MatchSrf > Position, with match by closest points un-checked, does that get things close enough? And can’t you do this in excel? Round the numbers?

@robertoruggeri - see if this gets things close enough -

SrfTuneup.py (2.9 KB)

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

-Pascal