Hello. I would like to know how to subtract 2 volumes in vrworld. Does a function already exist for this?

2 views (last 30 days)
Hello. I would like to know how to subtract 2 volumes in vrworld. Does a function already exist for this? For example, I would like to show a cube and the difference between this one and a cylinder placed into it. Thank you.
  1 Comment
Vincent Flotron
Vincent Flotron on 28 Jun 2023
Finally, I choose the following pragmatic solution. Driving OpenSCAD from MATLAB.
Below are the steps:
  1. Open OpenSCAD.
  2. In OpenSCAD, open the file 'myfile.scad'.
  3. From MATLAB, write the OpenSCAD commands in the file 'myfile.scad' to load two STL files of the objects, position them correctly, and apply the boolean operation.
  4. OpenSCAD will automatically detect the file has changed and update its view.
  5. From MATLAB, capture a screenshot.
  6. Repeat steps 2 to 5 until you have enough pictures to create a short movie.
  7. Use a MATLAB function to compile the pictures into a small movie.

Sign in to comment.

Answers (1)

Nishan Nekoo
Nishan Nekoo on 4 Mar 2025
Copying Vincent's solution from above as an answer:
Finally, I choose the following pragmatic solution. Driving OpenSCAD from MATLAB.
Below are the steps:
  1. Open OpenSCAD.
  2. In OpenSCAD, open the file 'myfile.scad'.
  3. From MATLAB, write the OpenSCAD commands in the file 'myfile.scad' to load two STL files of the objects, position them correctly, and apply the boolean operation.
  4. OpenSCAD will automatically detect the file has changed and update its view.
  5. From MATLAB, capture a screenshot.
  6. Repeat steps 2 to 5 until you have enough pictures to create a short movie.
  7. Use a MATLAB function to compile the pictures into a small movie.

Categories

Find more on Simulation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!