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.

Optics: Custom Feature

EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

It's been a while since I released any in-depth custom features, but I'm excited to finally make this one public! Optics is a tool for real-time feedback of optical designs in Onshape. I won't go into great detail on the ins and outs here since I have a very thorough demo video, but here are some teaser images. Enjoy!

Evan Reese

Comments

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    special thanks to @jnewth and @Alex_Kempen for code review and wisdom and to @maximilian_schommer for creating and sharing the original Ray Tracer feature way back when which was an inspiration.

    Evan Reese
  • S1monS1mon Member Posts: 3,039 PRO

    This looks great. The one immediate request I would have is how to better simulate typical lambertian LED dispersion patterns.

  • eric_pestyeric_pesty Member Posts: 1,947 PRO

    That looks awesome!
    I second @S1mon 's request for a lambertian distribution (I guess under the "Rays/Shape"?)

    Another thing that could be super useful would if there was a way to visualize a "heatmap" on the target.
    I can see how that could be tricky to do but maybe dividing the target surface in x sub-surfaces and applying a color based on the relative number of hits/area? Or even doing it manually for each selected target (i.e. do a zero offset surface of each one and apply a color based on density of hits).

  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    Thanks!

    Can you both help me understand what you'll use Lambertian for? I looked into it during development, but need to do more reading. My understanding is that it has 2 basic properties: (1) it looks the same no matter the viewing angle (perfect diffusion) and (2) the luminous intensity is dependent on the angle of incidence. This feature currently has no concept of luminous intensity. A ray is a ray is a ray. As for even distribution, I think that's what I'm already getting with the Cone (Randomized) shape. The odds of a ray being anywhere within the cone is equal unless I overlooked something, which is possible.

    @eric_pesty I want to keep it simple (okay it's already not simple), and also not try too hard to develop a replacement for a "real" optical tool. My current thinking on a "heatmap" is to just turn off the ray previews and just look at the intersections of rays and targets like this. It's enough to get an intuitive feel for it I think. Anything else would just be a layer of abstraction on top of this anyway which just means more code and more compute. btw, if you "keep rays" and move the slider at the bottom of the feature UI you can get a very light ghosted preview of the rays. Thoughts?

    Evan Reese
  • S1monS1mon Member Posts: 3,039 PRO
    edited December 7

    LEDs (and other light sources) have distribution patterns. They're often not even - even theoretically. Typically the specs are shown in a polar plot where the 1/2 angle shows where 50% of the intensity and above light is concentrated. It's somewhat like taking a bell curve and wrapping it.

    Ideally your feature would at least take the 1/2 angle, and assume some common distribution pattern to show what's likely to happen.


    https://www.bivar.com/resources/blog/led-emission-patterns-and-how-they-affect-your-application/

  • S1monS1mon Member Posts: 3,039 PRO

    I like the preview of the intersections of the rays and the output surface. That’s pretty helpful and similar to features in more dedicated tools.

  • eric_pestyeric_pesty Member Posts: 1,947 PRO

    Fair enough about keeping things simple and this not being a "full" analysis tool. However it's really not that far off!

    You've got the reflection and refraction covered and methods to shoot a bunch of rays through the geometry and that's really the bulk of it!
    While understand there is no concept of "intensity" of a ray in this model, my thought would be that the density of rays could be a good proxy for that.
    So instead of a cone with evenly distributed rays a lambertian distribution would have fewer and fewer rays at larger angles.

  • eric_pestyeric_pesty Member Posts: 1,947 PRO

    Used this today to get a feel for how realistic a more compact TIR would be (using the tip of hiding the "hits" to show the "density"):


    It's nice to be able to get a set of rays coming out from the face of the "LED" instead of a single point (like the Ray Tracer FS did) to take into account the size of the source.

    Detail of the rays used (face is the size of the primary LED lens):

Sign In or Register to comment.