I’ve been struggling to move forward on how to solve an issue I’m having. I am trying to create a CAD file based on a G-code file I have, but I keep running into problems with the geometry becoming invalid.
First, I tried using the Sweep1 command along the polyline curve from the G-code toolpath. However, because the toolpath has self-intersections, this approach keeps failing with an error.
Then I tried a different approach of extruding and revolving sections of the toolpath line to build up the model. But again, as I proceed through the line, the geometry keeps becoming invalid with issues like twisted surfaces or self-intersections.
I’m hitting a roadblock on how to reliably create a valid solid CAD model from this G-code file while maintaining accuracy to the original toolpath. Has anyone else run into similar issues converting G-code to CAD geometry? Any tips or different approaches I should explore?
For your refrecence, there is a Ghpython block in grasshopper which reads the attached json file.
I’ve attached the G-code file I’m working with in case that provides any additional context.
Thank you for your quick response. The does not show any error in Rhino but when I import the file in FEA software it shows invalid geometry in sections like in the picture. The image I uploaded previosuly is from Abaqus.
Thank you, this look much more improved. However it still has the invalid geometry proble.
Also, will the fillet function in grasshopper works the same? This is just one example file I have multiple files so I would like to automate the process.
If you click Yes to repair what happens? What are the highlighted problems? Are those locations the curve path start and end points where the profile started? I can’t tell from the image.
The repair does not solve the problem, it still shows the same error. One of the point is a start point of the polyline and one is end however the another one is random.
When checking the section view of the file, it seems that where the error is instead of solid merge it is removing the common part. I am sorry if this is Abaqus problem rather than Rhino problem.
Is there an effective way for solid union so I can merge the bodies two at a time?
I tried a bunch of stuff - not worth posting/showing any of it because they all resulted in (a) ugly results, (b) useless results, or (c) ugly and useless results.
From these methods the one that showed more promise was:
piping (instead of sweeping) the curves, the result is clean/valid (but not elliptical cross section)
extracting the circular cross sections (edges/curves) of these pipes, get their circle base planes, and deform/scale the circles to become elliptical (max ellipse radius divided by min ellipse radius = scale factor for X or Y axis, depending on plane alignment)
attempting the sweep with more cross sections per rail curve
It ‘worked’, breps were valid, however the sweep twists everywhere, so nevermind.
One suggestion is to use the handy MSweep (‘mesh sweep’) component from mesh tools:
The {new} issue is that the result is a mesh, so the suggestion is equally useless . Of course you can SubD the mesh result, but you’ll lose your corners. Alternatively you can just turn the mesh into a brep by joining all mesh face boundaries as polysurfaces, but the final appearance won’t be smooth.
Apologies for my useless contribution(s).
One question I guess would be about abacus: does it let you convert the mesh into surfaces that you can use? If yes, and in a way that retains the aspect of your desired end result, maybe it’s worth checking.