-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabled to export mesh as 3dxml format #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for your PR. I think it would make a great addition to this tool, so my comments are mostly around future maintainability.
Can you please add:
- A unit test for this functionality so that when I create a release I know it works appropriately.
- An additional section in the README to explain converting meshes to DAE
SW2URDF/UI/AssemblyExportForm.cs
Outdated
Exporter.ExportRobot(exportSTL); | ||
|
||
bool isSTL = radioButtonStl.Checked; | ||
Exporter.ExportRobot(exportSTL, isSTL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the mesh format an enum instead of a bool? This will help make it easier to add support for more file formats in the future
SW2URDF/URDFExport/ExportHelper.cs
Outdated
string windowsMeshFileName = package.WindowsMeshesDirectory + linkName + ".STL"; | ||
string meshFilename = package.MeshesDirectory + linkName; | ||
string windowsMeshFileName = package.WindowsMeshesDirectory + linkName; | ||
if (isSTL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of an if/else, can you use a switch with the enum?
SW2URDF/URDFExport/ExportHelper.cs
Outdated
// Export STL | ||
if (exportSTL) | ||
{ | ||
SaveSTL(link, windowsMeshFileName); | ||
if (isSTL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use switch
…rmats from if statements to switch statement
I'm sorry for the late reply. I've changed the bool to an enum of the export format. Although, I had a problem with the unit test. ProblemWhen I exported ORIGINAL_3_DOF_ARM, the links of the arm were shown in the wrong position in Rviz. Temporary solutionWhen I created the same coordinates and axis of each link at the top-assembly, and selected those in the export menu instead of those in the sub-assemblies, the links were shown in the correct position. As discussed in #116, I believe this issue can occur with SolidWorks later than 2018, but is this supposed to function correctly originally?
EnvironmentSolidworks version: 2022 |
@brawner |
@iory I believe this PR is still waiting for a unit test |
I have modified all the points you mentioned:
I would greatly appreciate it if you could kindly review the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thank you for the contribution!
This PR allows the URDF exporter to output mesh files not only in STL format but also in 3DXML format. This enables the export of models with color information.
This does not destroy the original functions.
This solves this issue.
#114
Exported in STL (no color)
Exported in 3dxml (with color)
How to convert to .dae format for ros