Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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
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
Independent Onshape Consultant | Industrial Designer
Independent Onshape Consultant | Industrial Designer
7
Comments
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.
Independent Onshape Consultant | Industrial Designer
This looks great. The one immediate request I would have is how to better simulate typical lambertian LED dispersion patterns.
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).
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?
Independent Onshape Consultant | Industrial Designer
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/
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.
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.
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):
So, so, so incredibly cool.
A hackish answer in the short term would be to impose a mesh on top of the light source, with the mesh having a density of holes which matches the distribution pattern. Not ideal, perhaps, but offloads from @EvanReese the work of figuring out out to ingest an arbitrary radiation pattern.
This is very cool, must have missed the announcement a while back.
Ty for sharing @EvanReese !
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Absolutely brilliant, and perfect timing. I was trying to make a light to illuminate my cockpit from a single source, and this gave me a great lens to try as a first step:
Source: https://cad.onshape.com/documents/de0ffcf0722e4cb755a935b0/w/66f79fda38e50b49363829fc/e/97519f02910bfe5599a21d76?renderMode=0&uiState=67e0c501afd6660f54d9f74c
@kenn_sebesta167 I love seeing it used. I haven't had much opportunity to validate the feature with real-world testing, so please report back if you would. I'd love to know that it worked, or more importantly, if it's off somehow.
Independent Onshape Consultant | Industrial Designer
It worked really well and very easily. The main two hiccups I can think of right:
The next step is to print it out in some clear resin.
(Actually, the real next step is to get a properly dimensioned model of the airplane cockpit, as I made some pretty coarse guesses.)
@kenn_sebesta167 Thanks for the feedback. I suppose I could cull points that aren't on the selected face. Good thought. Your use case makes me think that the point inputs should have something other than cones emanating from one point. They should probably also support some round or square grid shapes.
I'd also love to know if the lack of lambertian distribution is actually getting in the way of people who are actually using the tool. If, so let me know.
Independent Onshape Consultant | Industrial Designer