Skip to content
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

CREO2URDF – Export stl meshes of twolinks asm #11

Closed
Nicogene opened this issue Mar 13, 2023 · 6 comments · Fixed by #12
Closed

CREO2URDF – Export stl meshes of twolinks asm #11

Nicogene opened this issue Mar 13, 2023 · 6 comments · Fixed by #12
Assignees
Labels
domain-software Related to Software team-fix Related to Team Fix

Comments

@Nicogene
Copy link
Member

Task description

We should extend creo2urdf in order to export the stls files of the meshes of twolinks assembly.

Definition of done

The PR that add this feature is merged.

@Nicogene Nicogene added domain-software Related to Software team-fix Related to Team Fix labels Mar 13, 2023
@Nicogene
Copy link
Member Author

I started working here: #12

Right now I have managed to export the stl of the entire asm

immagine

I used pfcSTLBinaryExportInstructions but there is also pfcShrinkwrapSTLInstructions for exporting it.

@fiorisi @salvi-mattia @Mick3Lozzo what is the difference between "export a part or assembly to a binary STL file" and "export a shrinkwrap STL file" ?

Maybe before starting the course (20-31 March) @mfussi66 and I could have a chat with you for understanding what composed our simulation model cad in order to have the right questions to do to the instructor.

@Mick3Lozzo
Copy link
Member

Mick3Lozzo commented Mar 16, 2023

what is the difference between "export a part or assembly to a binary STL file" and "export a shrinkwrap STL file"?

@Nicogene I think that the second one is an ASCII file. The two formats contain the same information about the model, but the binary format is much more compact, so it will produce smaller files from the same part and it is better for 3D printing.

@fiorisi @salvi-mattia 🤔??

@Nicogene
Copy link
Member Author

Nicogene commented Mar 17, 2023

Today I tried to navigate the asm

if (model_ptr->GetType() == pfcMDL_ASSEMBLY) {
auto assembly_ptr = pfcAssembly::cast(model_ptr);
auto items_ptr = assembly_ptr->ListFeaturesByType(pfcFEATTYPE_COMPONENT);//pfcITEM_SIMPREP);
if (items_ptr) {
message.clear();
message << "Number of Items found is " << items_ptr->getarraysize() << "\n";
for (int i = 0; i < items_ptr->getarraysize(); ++i) {
auto item_ptr = items_ptr->get(i);
message<<" "<<item_ptr->GetName()<<" ";
}
printToMessageWindow(session_ptr, message);
}
}

Unfortunately I didn't manage to get the parts that compose the assembly, this is the output

immagine

Note that the two nil at the end seems to be

immagine

@fiorisi
Copy link
Member

fiorisi commented Mar 17, 2023

what is the difference between "export a part or assembly to a binary STL file" and "export a shrinkwrap STL file"?

@Nicogene I think that the second one is an ASCII file. The two formats contain the same information about the model, but the binary format is much more compact, so it will produce smaller files from the same part and it is better for 3D printing.

@fiorisi @salvi-mattia 🤔??

Sorry for the late answer. Another difference could be the following.

  • "export a part or assembly to a binary STL file" -> generates an STL file of the part, or in case of assembly generates an STL file for each part of the assembly
  • "export a shrinkwrap STL file" -> in case of assembly generates an STL file that is the shrinkwrap of the assembly

I will investigate further though.

@Nicogene
Copy link
Member Author

Thanks to the course on Toolkit we are following @mfussi66 and me, today I was able to:

  • Disable of the button if no assembly/parts are in the session
  • Export of the stl meshes of all the parts in the session

See c5a3e3b (#12)

immagine
immagine

@salvi-mattia
Copy link
Member

please note that in creo language "in session" means every parts it is in RAM so it includes all the opened parts we have at that moment.
as we saw with @mfussi66 it's hopeful to make a test.
the old, mathweb, pulsantone created the mash of the parts in the window, not in session.

not a big problem but something to know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain-software Related to Software team-fix Related to Team Fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants