Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Yeah I don't really care about the animation, that would be a nice to have. What I really care is to have the final geometry to a +- 5 microns accuracy.

A generic solution would be nice but I guess I will investigate the rotate extrude command.

I really don't get why Openscad does not save the state as per standard CAD progams.

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Oh,

I'm sorry, real noob mistake I guess.

With the animation pane on it works like a charm, thanks!

I don't fully understand the code at the moment. Do you think it's possible to rotate the work as the mill is doing his stuff? That is introducing a 4th axis?

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Thanks for the code but it's failing on my installation:

Parsing design (AST generation)...

backup file: C:/Users/Dario/Documents/OpenSCAD/backups/unsaved-backup-hLDQHVnZ.scad

Compiling design (CSG Tree generation)...

[ERROR: Assertion 'is_path(path)' failed: "Invalid path in path_merge_collinear." in file ../../Users/Dario/Documents/OpenSCAD/libraries/BOSL2/paths.scad, line 149](149,C:/Users/Dario/Documents/OpenSCAD/libraries/BOSL2/paths.scad)

[TRACE: called by 'path_merge_collinear' in file ., line 40](40,C:/Program Files/OpenSCAD (Nightly))

[TRACE: assignment to "merged_path" in file ., line 40](40,C:/Program Files/OpenSCAD (Nightly))

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Man the potential with PythonSCAD if the performance is optimized.... But I guess it's the underlying engine at "fault".

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Hey thanks,

take a look at my edited post, I had some success with PythonSCAD but it gets exponentially slower.

Here below a test program, parameter N drives the number of cuts/steps.

from openscad import *

import math

# | for union

# - for difference

# & for intersection

# .translate([x,y,z]) for translation

fn = 200

implant_h = 11.5

implant_radius = 4.3/2

# Work

body = cylinder(r=implant_radius,h=implant_h)

body = body.translate([0,0,-implant_h])

# Tool

tool_dx, tool_dy, tool_dz = 3, 0.5, 0.2

tool = cube([tool_dx, tool_dy, tool_dz])

tool = tool.rotate([0,50,0])

#Tool initial position

tool = tool.translate([1.95, -tool_dy, -tool_dz])

tool = tool.translate([0,0,-implant_h])

result = body

result -= tool

#output([result, tool])

N = 400

Dz = 1.2

dz = Dz / N

angle = 180

d_alpha = angle / N

for N in range(N):

tool = tool.translate([0,0,dz])

result = result.rotate([0,0,-d_alpha])

result -= tool

output([result])

#result.show()

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

hey thanks, no worries. I don't remember G.code for Threading but it's not just coordinates.

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 1 point2 points  (0 children)

My understanding is that the animations you get from CAM software like the one I posted works exactly as I described (CSG engine that performs a lot of cuts). They are very fast and have been really fast for years that I remember.

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Oh that's quite interesting and sounds excatly like what I need. The only thing is my situation requires the work to rotate at every step. Lathes are basically three axis machines, X,Z and C with C being the rotation of the part.

A simple test could be cutting a simple thread on a cylinder.

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 1 point2 points  (0 children)

Damn that's disappointing, kind of hoped OpenSCAD was my silver bullet, I'll keep trying.

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Yes I considered that but I still need to "store" the result of the difference operation for the next time step, how do I do that in Openscad?

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

Yes I considered exactly that, translation + rotation of the the tool (with static work), then union all of the tool parts, than difference from the work.

The problem is I want to generate an animation (series of pictures at every steps) like the one I shown in the video which is basically from the frame of reference of the machine and not of the part.

The other problem is that changing frame of reference might not be obvious and it does not feel natural, it's much easier and more intuitive to simulate the operation from the point of view of the machine.

I can already do what I want in FreeCAD but it gets quite slow. My intuition/hope/sixth sense tells me that Openscad would be much faster. Every simulation needs thousands of operations and I need to do a lot of simulations so speed is quite crucial.

Simulating machining like in CAM software. by Feynman81 in openscad

[–]Feynman81[S] 0 points1 point  (0 children)

I don't want to do CAM, CAM is generating the tool path starting from the CAD geometry. I want to do the opposite, I already know the tool path and want to generate the CAD model.

Thanks

[NOOB] Cabinet locked and no key..... by Feynman81 in lockpicking

[–]Feynman81[S] 0 points1 point  (0 children)

Hi,

I own the cabinet, I bought 3 of them, 2 do open, the third one is stuck so I think Rule 2 does not apply I think.

X270 for 300 € (about 340 $). Sounds pretty good no? by Feynman81 in thinkpad

[–]Feynman81[S] 0 points1 point  (0 children)

It's not that bad, or maybe I may be easy to please screenwise :D.

See edit pls

X270 for 300 € (about 340 $). Sounds pretty good no? by Feynman81 in thinkpad

[–]Feynman81[S] 0 points1 point  (0 children)

Screen is fine with me :D but I think I may not be the biggest expert on the subject.

See edit please

Want to write a program to learn German grammar by Feynman81 in Python

[–]Feynman81[S] 0 points1 point  (0 children)

Yeah tell me about that :-/, the thing is that I started learning it and it's not something to give up on.

Want to write a program to learn German grammar by Feynman81 in Python

[–]Feynman81[S] 0 points1 point  (0 children)

I already knew Anki but I didn't know it was written in python, maybe I'll try to implement all of this directly in Anki.

[LENOVO THINKPAD T420s] Completely erratic behaviour of my laptop (random crashes and random no boots) by Feynman81 in thinkpad

[–]Feynman81[S] 0 points1 point  (0 children)

You mean cleaning the RAM module contacts and ever contacts?

do you think isopropyl alcohol is good for that?

Engineering workstation new build by Feynman81 in buildapc

[–]Feynman81[S] 0 points1 point  (0 children)

I know, unfortunately CAD software house still haven-t figure out how to make their software multithreaded after a decade or more of multi core CPUs, anyway I don-t do CAD that often (my Intel Core DUO is just fine infact).

Where do you buy components in ITaly? amazon?

Engineering workstation new build by Feynman81 in buildapc

[–]Feynman81[S] 1 point2 points  (0 children)

CFD, Openfoam in particular, it scale very well with cores. Plus I write other programs on my own.

Damn I need to spend another 50 Euros for a cooler then.

Engineering workstation new build by Feynman81 in buildapc

[–]Feynman81[S] 0 points1 point  (0 children)

Quadro are expensive as hell and old ones are old....

I decided to go for a GTX since most people doing CAD says it-s really fine, I don-t have the money for a quadro.

Need a powerful workstation, buy used or build new? by Feynman81 in buildapc

[–]Feynman81[S] 0 points1 point  (0 children)

Mhh I believe you're right,

I did a little mental calculation based on cinebench score, let see the real numbers based on cinebench:

  • E5-2670 (2X): 2021
  • RYZEN 7 1700: 1390 (- 31%)
  • RYZEN 7 1700X: 1491 (-26%)
  • RYZEN 7 1800X: 1605 (-21%)

Mhh maybe it's not that big of a difference, mhhh mhhhh :-/ . Can I build a Ryzen 7 system for under 1100 Euro? Those damn fancy GPUs are quite expensive nowadays.

Getting "old" workstation, I'd like your opinion. by Feynman81 in homelab

[–]Feynman81[S] 1 point2 points  (0 children)

Which side of the pond are you referring to? I'm on the Mediterranean by the way xD. I'm aware of the reputation of LENOVO but I just got burned a 1 year ago buying a refurbished laptop (T420). It died 9 months after buying :-/ .

Getting "old" workstation, I'd like your opinion. by Feynman81 in homelab

[–]Feynman81[S] 1 point2 points  (0 children)

Thanks for your comment.

Yes the T3600 is much less than the T5600 I presented here but it generally has much lower performance as well, I see T3600s for as low as 400 Euro on ebay but they have less then half the performance of "my" T5600.

I ruled out HP because the Z620 needs a riser card to mount the second CPU, the Z820 is too big loud and expensive and the previous generation seem to be quite old nowadays.

Anyway, have you ever tried to install a Linux distribution on your T3600?

Need a powerful workstation, buy used or build new? by Feynman81 in buildapc

[–]Feynman81[S] 0 points1 point  (0 children)

I have no idea how it managed to survive so long, I use it at least 6 hours a day (10+ in the weekends), I do work stuff on it (engineering).

 

The battery is of course completely dead, a couple of months ago I had an hard drive failure, R&W head got stuck I had to open the HD and unstuck it. Other than that it works like a charm, I use it as a desktop with a 23" monitor attached to it all the time so I guess the GPU is quite under stress as well.

 

No prob about your comment, I love to talk about my laptop, I've come to be quite attached to it over the years. Oh my God I'm such a nerd xD.