Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Monte Carlo generation of solid geometry...

john_P37john_P37 Member Posts: 26 PRO
   Searching for "Monte Carlo", I get zero hits, so here goes:
I want to model the optical performance of an assembly with about 5 parts. The parts could vary, and their relative assembly position could vary.  I want to use Monte Carlo methods to generate a large number of STEP files for the complete assembly, and then feed those to the optical analyis program. 
   Has anyone done anything like this?  Is it possible with FeatureScript (I don't know FeatureScript, but I'll consider diving in if it supports this).  
    I realize I could generate the mathematical equations that relate all the surface features to an input vector of random variables, but that will take some time, and if I make a mistake I'm likely to not know until the device is built.  Which is a bad time to find out. 
  Best regards, 
  John

Answers

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,937 PRO
    Caand especially Onshape is not built for random numbers. That being said i did see a work around feature script to generate randomness, but i doubt it would suit your need
  • harmanpaharmanpa Member, User Group Leader Posts: 11 PRO
    I do think Onshape is the ideal tool for this, but rather than FeatureScript, this sounds like something you would need to drive from the external APIs. I would:
    * make a model in Onshape of the geometry
    * use configuration parameters to define the variables that are going to change
    * test that changing those parameters within Onshape gives the expected geometry
    * write an external tool that does the Monte Carlo sampling and calls the Onshape API. It is possible to perform a STEP export with a given configuration, so it is a relatively straightforward process to get the STEP file for each set of values.

    thanks

    Pete
Sign In or Register to comment.