VTK based version of Vismach

  • Aciera
  • Aciera's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
25 Oct 2025 07:27 - 27 Oct 2025 13:44 #337114 by Aciera
VTK based version of Vismach was created by Aciera
This is a new version of the 'vismach' simulation tool based on VTK instead of OpenGL:
github.com/Sigma1912/vtk-vismach

Still work in progress.
For more information see the README and the comments in the files.
 
Attachments:
Last edit: 27 Oct 2025 13:44 by Aciera.
The following user(s) said Thank You: tommylight, rodw, Unlogic

Please Log in or Create an account to join the conversation.

More
26 Oct 2025 16:55 #337223 by andypugh
Replied by andypugh on topic VTK based version of Vismach
That's very pretty.

Is it any easier to comprehend than Vismach? I find using Vismach rather confusing (and I wrote the docs!)

Please Log in or Create an account to join the conversation.

  • Aciera
  • Aciera's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
26 Oct 2025 17:42 - 26 Oct 2025 17:44 #337230 by Aciera
Replied by Aciera on topic VTK based version of Vismach
It's pretty much the same. It's actually fairly straight forward once you get the hang of it but I guess that's true for everything and I must have made a couple dozen sim models by now.
ProbeBasic has machine simulation that can be setup using a yaml file (similar to what some CAM systems have) but it is quite limited compared to vismach.

 
Last edit: 26 Oct 2025 17:44 by Aciera.

Please Log in or Create an account to join the conversation.

  • Aciera
  • Aciera's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
05 Nov 2025 09:45 #337876 by Aciera
Replied by Aciera on topic VTK based version of Vismach
Since I had to use PyQt to work around a bug with vtk Timer I added a small optional UI: 

 

 
Attachments:
The following user(s) said Thank You: tommylight, Unlogic

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
05 Nov 2025 12:00 #337878 by tommylight
Replied by tommylight on topic VTK based version of Vismach
Awesome!!!

Please Log in or Create an account to join the conversation.

More
14 Nov 2025 21:59 #338405 by andypugh
Replied by andypugh on topic VTK based version of Vismach
Do you want to submit a pull request?

Please Log in or Create an account to join the conversation.

  • Aciera
  • Aciera's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
15 Nov 2025 08:09 #338450 by Aciera
Replied by Aciera on topic VTK based version of Vismach
I certainly could but would we want to make the python vtk module a runtime dependency?

Please Log in or Create an account to join the conversation.

More
17 Nov 2025 21:26 #338577 by andypugh
Replied by andypugh on topic VTK based version of Vismach
It's 52MB on top of a stock Bookworm install.

What was your motivation for doing it? Do you think that others will share that motivation?

Please Log in or Create an account to join the conversation.

  • Aciera
  • Aciera's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
18 Nov 2025 08:27 #338605 by Aciera
Replied by Aciera on topic VTK based version of Vismach
The current opengl implementation seems dated. For example setting transparency has been broken for a while now. I'm interested in more complex simulation models that can, among other things, load 3d geometry at runtime and have a more modern look while still offering a reasonably manageable learning curve.
I had a look at using modern opengl but it is more complex than the old style we currently use and I could not get a grip on it.
ProbeBasic uses vtk for its preview display, so I had a look at that and found it quite easy to work with.
I guess it's a situation similar to GUI development, we could just have gone on using tkinter, which comes with every python installation, but GTK and later PyQt (which is also required for this variant of vismach) offered so much more capability.

For somebody who wants to build a simulation model vtk-vismach will certainly offer new opportunities but building simulation models is rather a niche activity so I'm not sure it is worth adding yet another library at this point.

Please Log in or Create an account to join the conversation.

More
04 Oct 2026 17:16 #350105 by Vegko
Replied by Vegko on topic VTK based version of Vismach
I have converted my old vismach to this VTK and i must say that i am impressed with it!
My configuration is only a simple 3 axis machine.
In the attachments, my configuration (vtkvismach is in the config folder) and 3d files (these go in your nc_files folder)

Some pro's for the new VTK implementation, in my opinion:
  • Smaller stl from freecad (old vismach you needed to export as .ast, now normal .stl)
  • In less lines you can configure your machine.
  • Model groups are a real nice way to toggle off machine components you don't want to see during simulation.
  • Transparent stock!
  • Runs from you config folder stand alone.
  • You can start it while your program is already running, or even if your machine is not homed yet.
  • Quick switching of the viewing planes.
I found out that (in any case by HUD) that using hal pin's and don't create hal pins with the vtkvismach script makes you able to restart vtkvismach without restarting linuxcnc since you don't create double hal pins. For creating your model this faster.
The pins necessary for my HUD are now created in "custom.hal".
 
Also i added a few extra lines (classes) to vtk_vismach.py, some for my own preferences/use
  • ini_work_file:
    ini file reading, i use a ini file in the NC folder to specify my Job, in the ini file you can state your workpiece, raw stock and the work holding. In my example the files are read from the nc_files folder. 
    • Syntax:
      • Product_stl=ini_work_file('WorkpieceModel', 'solidname').database_read(INI_Path_File)
  • Polygon:
    enter a polygon solid in Z direction (for example: used for my stock creation from hexbar to round)
    • Syntax:
      • Polygon((comp),x_center, y_center, z_center, length, radius, number_sides, inscribed)
      • number_sides = number of polygon sides
      • inscribed = boolean = if the given radius is: read as inscribed, measured on flats (1) or measured on the points (0).
  •  ThreadBox:
    Creates a box of "wiremess" (for example: used for my working area)
    • Syntax:
      • Polygon((comp),xmin, ymin, zmin, xmax, ymax, zmax, radius, sradius)
      • xyz min and max for your corners.
      • radius =  the radius of the ribs.
      • sradius = the radius of the sphers on the corners.
  • Small aditions, icon, View_Ori and TextHeightButtons (to keep the screen small with to many model groups).
  •  Made parallel the starting option.
  •  Changed "show overlay" from radio button to check box
  •  CylinderOriented, this function won't work if xystart and xyend are equal. i added some (brute force) logic to check and bypass the used matrix.
 Aciera thanks for providing this nice simulation tool!

Please Log in or Create an account to join the conversation.

Time to create page: 0.165 seconds
Powered by Kunena Forum