Rhoban / onshape-to-robot

Converting OnShape assembly to robot definition (SDF or URDF) through OnShape API
MIT License
231 stars 49 forks source link

STL name conflict resulting in error in visual mesh #117

Open T-K-233 opened 5 months ago

T-K-233 commented 5 months ago

Currently, STL files are exported with names set to the corresponding part name. This will result in error under the following circumstance:

Assembly
 |- Sub Assembly A
   |- Part A
   |- Part ...
 |- Sub Assembly B
   |- Part A
   |- Part ...
 |- Sub Assembly ...

Part A in Assembly A and B will be exported to be a same STL file. However, this will result in error in offset, since the assembly origin in Sub Assembly A and B are not necessarily the same. This will result in some meshes offseted by some distance from their correct location in the visual viewer.

To solve this, one possible solution is to allow the option to name the exported STL files in terms of SubAssemblyName_PartName.stl

e.g. instead of part_a.stl, we will have sub_assembly_a_part_a.stl and sub_assembly_b_part_a.stl.