MATLAB Answers

Editing geometry imported from SolidWorks to Simmechanics

4 views (last 30 days)
Pouya Jamali
Pouya Jamali on 1 Feb 2015
Answered: Steve Miller on 25 Jun 2021
I need to optimize my multibody dynamics system in terms of geometry. The problem is that the initial geometry is complex and difficult to design using Simmechanics' means. So I tried to import it from a CAD software (SolidWorks). I'm wondering if there would be a way to define geometric parameters for an imported model. Or maybe editing stl files through programming. I need this to be able to run an optimization on the topology of a mechanism I have.

Answers (1)

Steve Miller
Steve Miller on 25 Jun 2021
You have a few options here, but they will all involve a bit of programming. In all options, you will need to identify the parameters you wish to vary and how they affect the dimensions and inertial properties of your parts. The option you choose will depend on which programming language you are most comfortable in and how important the visualization of the geometry looks during the optimization.
  1. Create an assembly of solids in Simscape Multibody that roughly represent your part. Using standard geometry (spheres, cylinders, bricks) and custom geometry (extrusions, revolved solids) you can probably get close enough to what the CAD geometry would look like. Take a look at the Simscape Multibody Parts Library for inspiration.
  2. Cut your CAD geometry up into pieces and connect those pieces in Simscape Multibody with parameterized Rigid Transforms so that you can change lengths as offsets from the original geometry. You may have gaps/overlaps in the geometry during the test, but that can be overcome by bridging it with standard solids.
  3. Learn the CAD API and determine if you can trigger updates to the CAD model from within MATLAB and trigger the CAD system to re-export the CAD geometry. In this case, you will probably have the most accurate result, but the programming and execution time will be quite high. I would suggest you try options 1 or 2 first, get the parameters close to what you need, and then manually adjust the CAD part.

Community Treasure Hunt

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

Start Hunting!