Monte Carlo generation of solid geometry...

john_P37
john_P37 Member Posts: 27 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_mcclary
    john_mcclary Member, Developers Posts: 4,110 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
  • harmanpa
    harmanpa Member, User Group Leader Posts: 12 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