Author Topic: Errors in stl File - Mesh Correction Tool  (Read 907 times)

Offline electrosteam

  • Ewok
  • *
  • Posts: 35
    • View Profile
Errors in stl File - Mesh Correction Tool
« on: July 03, 2025, 02:06:39 am »
I am milling 5" miniature railway wheels in cast iron using an stl file generated by FreeCad.
The stl file opens and appears Ok in Blender.

The wheel has 8 spokes, so the MOPs are divided up into 8 separate stages of Pocketing and Waterline Finishing to a depth of 9.3 mm.
Using a polyline as a boundary and 5 mm carbide bull cutter, CB took 3.5 h to analyze and 2 h to write out.
The file is 750 kB and runs 36 minutes for an acceptable result.
 
First couple of  pockets went Ok.
Reduced the depth increment from 0.1 mm to 0.2 mm for the 3rd pocket to see the effect on code generation times and finish.
CB spent a couple of hours of analysis, 25 minutes of writing, for a trivial small Gcode file that  is very wrong.

Errors were reported during the process, incomplete polylines etc.

What recommendations can be mode for a stl file mesh correction tool ?

John
« Last Edit: July 04, 2025, 05:57:17 am by electrosteam »

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1983
    • View Profile
    • pixelmaker
Re: Errors in stl File - Mesh Correction Tool
« Reply #1 on: July 03, 2025, 09:14:28 am »
I would first attribute the CB behaviour you describe to a bad mesh. Blender is certainly not the specialised programme for repairing meshes. First, the 3D object should be created cleanly. For the analysis I use Meshmixer, MeshLab or Netfabb. There are free versions of all 3 programmes that you just have to search for. The settings for the resolution and scanning precision in CB are important and must match the resolution of the mesh.

But when I think about your description, I don't understand why you want to mill such a wheel in 3D. This is a typical application for a profile or/and pocket mop.
Perhaps you could show the file or at least a picture of this wheel.


ralf

Offline Tool-n-Around

  • Wookie
  • ****
  • Posts: 304
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #2 on: July 03, 2025, 11:35:11 am »
But when I think about your description, I don't understand why you want to mill such a wheel in 3D. This is a typical application for a profile or/and pocket mop. Perhaps you could show the file or at least a picture of this wheel. ralf

+1. Agree with Ralf unless there are some unusual 3D contours, In CB I usually just use edit>surface>silhouette or plane slice to get the profiles, then clean up those polylines, and use them for a 2.5D program.....much faster.

Best,
Kelly

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 9024
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #3 on: July 03, 2025, 15:20:25 pm »
Further, you wrote that you 'reduced' the depth increment from 0.1mm to 0.2mm.  That's INCREASING the depth increment, and should have improved your rendering times.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline electrosteam

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #4 on: July 04, 2025, 05:56:04 am »
Thanks for all the comments.

Attached is a screenshot from FreeCad.
Featured are tapered oval spokes that I wanted to reproduce closely.

Is this a candidate for slicing ?
I will investigate silhouette and plane slice".

Duh, sorry about the terminology mix-up.
When I was writing I was thinking "reduced number of cutting paths".
Rendering times were reduced.

I run Linux, so some programs are not available.
But, I will check out Meshmixer, Meshlab and Netfabb.
Blender was used simply because that is all I had.

John.

Offline pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1983
    • View Profile
    • pixelmaker
Re: Errors in stl File - Mesh Correction Tool
« Reply #5 on: July 04, 2025, 08:53:15 am »
perhaps you can attach the STL file.

I would mill the outer wheel in 2.5D.
However, I would draw circles, because Silhouette or Plane Slice always have angular lines due to the polygons, never a circle.
I would only mill the inner part with the spokes in 3D. The hub is then 2.5D again. The whole thing can be done with several machining operations from one file. A two-sided machining must be done anyway


Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2666
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #6 on: July 04, 2025, 12:03:45 pm »
perhaps you can attach the STL file.

I would mill the outer wheel in 2.5D.
However, I would draw circles, because Silhouette or Plane Slice always have angular lines due to the polygons, never a circle.
I would only mill the inner part with the spokes in 3D. The hub is then 2.5D again. The whole thing can be done with several machining operations from one file. A two-sided machining must be done anyway
Exactly!

Offline Tool-n-Around

  • Wookie
  • ****
  • Posts: 304
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #7 on: July 04, 2025, 13:23:46 pm »
perhaps you can attach the STL file.

I would mill the outer wheel in 2.5D.
However, I would draw circles, because Silhouette or Plane Slice always have angular lines due to the polygons, never a circle.
I would only mill the inner part with the spokes in 3D. The hub is then 2.5D again. The whole thing can be done with several machining operations from one file. A two-sided machining must be done anyway

Drawing circles would be the easiest "clean up" I was referring to but using silhouette creates polylines that can quickly and easily be measured for position and size to create fresh geometry in CB whereas with the stl.....not so much. Once you have established the center of the axle bore on the stl (placement at origin would be convenient), drawing all the concentric round features becomes a trivial matter. The spoke pattern inside the outer rim looks like one of those shapes that just screams for a Waterline MOP......but I just can't seem to put up with the CB compute times. Little more work to bound so not unnecessarily cutting excess stock between the spokes but it's such a small part......not much material to remove.....depending upon your machine and material you are cutting.

Best,
Kelly

Offline electrosteam

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #8 on: July 05, 2025, 05:23:37 am »
Prior to milling, the bore is reamed on the lathe and the tread/flange roughed out.
Considering roughing out the full cross-section in addition.

Final tread/flange will be done once the wheels are mounted onto axles.

This a hobby machine, so long duration code generation is not really a problem

Included is a link to the STL file.
Hope this works as it is my first effort.

https://files.catbox.moe/z0dowy.zip

For those that might be interested, here is the FreeCad file:

https://files.catbox.moe/d3fb2p.FCStd

John

Added:
My MOPs are on the back of the wheel, flange uppermost.
The first pocket is at the top, then CCW for the 2nd and 3rd.
The 3rd one fails for a Waterline Finish with the boundary shown.
« Last Edit: July 05, 2025, 05:32:08 am by electrosteam »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5296
  • Made in England
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #9 on: July 05, 2025, 22:04:29 pm »
See attached CB file, this is just a quick example of the method I would use.

1. rotate stl to flange uppermost
2. align stl to centre,centre,top
3. find edges of stl
4. make a copy of polylines 6 & 9 and conver to "Region"
5. use 3D mop, example sets depth to 10 (just over halfway through wheel), depth inc. 0.1, tool 2mm ball nose, region as boundary object (all sizes in mm)
use waterline rough method.

As Ralf said, the other side will also require similar treatment.
Any other surfaces are cut either on a lathe or using 2D methods
« Last Edit: July 05, 2025, 22:11:12 pm by EddyCurrent »
Filmed in Supermarionation

Offline electrosteam

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #10 on: July 06, 2025, 05:22:19 am »
Tried file straight from zip:
Noted that Tool #99 not in the Tool Library.
Also Profile listed as "Ball Nose" - how does one enter this ?

Report: 'Stepover must be positive and non-zero"
Calculation for 6 seconds, to give nil result.

Added StepOver - 0.2.

Report: 5 ball steps
Calculate paths: Duration: 11:30
Warnings for open poly:
at -3.9 offset 2x 1.7992, 2x 2.1992.
at -4.9 offset 3.3992, 3.7992, 4.1992.
At -5.0 offset 5x 3.7992.
Tool Library "Default-mm' not found.
Tool index (99) not found.
Computer abandoned for 90 minutes.
A 52 MB file generated that Camotics could not open, reporting errors.
CamBam opened the file, looks impressive.
1,000,033 lines of Gcode ! The largest I have ever dealt with.
Though, obviously at the limit or graphic responsiveness on my computer.

Now to sort out the crossover and tool table problems.
Then MOPs to a depth of 1 mm to get comfortable with calculation times versus finish.
With errors in the stl file still to be investigated.

Thanks to all for your assistance, especially EddyCurrent for pointing me to Regions.
John.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5296
  • Made in England
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #11 on: July 06, 2025, 09:08:15 am »
It looks like you have issues.

Also tried file straight from zip:

1. Tool 99 is not in the library, it's not a good idea to use tool No.0 so I use 99 as a quick way to add a temporary tool, the error can be ignored
2. There is a drop down tab for tool profile if you click in the grid, select ball nose from there.
3. I left stepover at the default 0.4, it looks like you set it to -0.2 which is incorrect.
4. Everyone should have the Default-mm tool library installed however the error can be ignored.
5. calculation on my windows 11 with Cambam v1.0 64 bit took 1min 33sec. to produce the G-code.
6. g-code file size 12k, 367,427 lines (Mach3 pp)

I will take a look at the other errors you mention regarding open polys but be aware that Cambam does sometimes report these but they have no impact.
« Last Edit: July 06, 2025, 09:18:36 am by EddyCurrent »
Filmed in Supermarionation

Offline electrosteam

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #12 on: July 06, 2025, 09:50:16 am »
Thanks for the effort.

Your MOP differs from mine in a few areas.
I am away from my workshop at the moment, could be 18 h before I get back to check your version.
My workshop desktop is a Linux 64 bit Lubuntu system of moderate performance.

The StepOver was coded as 0.2, not -0.2;  another poor choice of language.

My installation does not allow selection of tool profile in the drop-down dialog.
Tried many times.

John.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5296
  • Made in England
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #13 on: July 06, 2025, 12:26:39 pm »
I forgot to mention, there was a small cube at the centre of your stl that I had to eradicate before importing to Cambam.
Filmed in Supermarionation

Offline electrosteam

  • Ewok
  • *
  • Posts: 35
    • View Profile
Re: Errors in stl File - Mesh Correction Tool
« Reply #14 on: July 08, 2025, 07:30:55 am »
The cube in the centre is, I think, a left-over from Blender.
A quick search shows that the cube is the default when opening Blender, but can be deleted.
I will watch this in future.

Downloaded MeshLab and opened the errant STL file with the option to integrate vertices cleared.
Looks impressive, very crisp rendering and responsive 3D scrolling.
Showed 121,078 Faces and 363,234 Vertices.

Selected Filters in the Menu, Cleaning and Repairing, Remove Duplicate Vertices - no change to count.
Then Merge Close Vertices - count dropped to 120,732 Faces and 60,352 Vertices.
It appears to be operating in mm, with a Merge Distance of 0.0096 mm?.

When Exported back to file, size dropped from 6.1 MB to 6 MB.
Opened the changed file in CamBam - looks the same.
But, will generate code to see if problem persists.

Thanks pixelmaker for suggesting MeshLab, it looks very capable.

Did a wheel pocket last night, 35 minutes, result nearly good enough.
Need to improve Boundaries.
This makes a wheel side more than 4 hours, probably a bit much.
I will also try a test using the Region suggested by EddyCurrent.

It is all the little things that make improvements, thanks to all.
I will be missing for a week or so.
John.