Little Addon for optical lenses etc.
Re: Little Addon for optical lenses etc.
Finally had some time to continue. First addition: Material textbox as suggested by B.Y.O.B. (thanks!) together with checkboxes for smooth shading and adding an edge-split modifier.
The material must be pre-defined on some dummy object. It does not work to create a lens/mirror, add a material to it, rename the material and then enter the name in the textbox. (It only works if the material is called "Material", because Blender will automatically rename it in this case )
The material must be pre-defined on some dummy object. It does not work to create a lens/mirror, add a material to it, rename the material and then enter the name in the textbox. (It only works if the material is called "Material", because Blender will automatically rename it in this case )
Re: Little Addon for optical lenses etc.
I just updated this addon to work with 2.8.
No functional changes yet, aside from expanding the readme, but I now want to continue adding more surface types or even the option of dynamic changes discussed before (If I can manage that )
No functional changes yet, aside from expanding the readme, but I now want to continue adding more surface types or even the option of dynamic changes discussed before (If I can manage that )
Re: Little Addon for optical lenses etc.
That's what I've wanted to make! It's great that now I don't have to
And here's my opinion
1. Blender (2.79b) crashes when N1 goes below zero, so I'd add min parameter equal to at least 0
2. With unit parameter, input field would accept and display length units:
3. With edge split object will be exported as 3 separate meshes, right? What would happen to volume?
And here's my opinion
1. Blender (2.79b) crashes when N1 goes below zero, so I'd add min parameter equal to at least 0
Code: Select all
num1 = IntProperty(
name="N1",
default = 32,
description="Number of radial vertices",
min = 3
)
2. With unit parameter, input field would accept and display length units:
Code: Select all
lensradius = FloatProperty(
name="Lens Radius",
default = 3.,
description="Lens outer radius",
unit = 'LENGTH'
)
CPU Bidir + Metropolis | Core i5-4570
Re: Little Addon for optical lenses etc.
Good suggestions no. 1. and 2. ! I will implement that.
Regarding no. 3, so far I have not observed any problems, but that doesn't mean thee will never be any
Good reminder though, casue I wanted to try making my own edge-split for this. The blender default has the issue anyways that it stops working at shallow angles. Not sure it works though without breakign the mesh... I will try.
Edit: Nope, not quite that easy
Re: Little Addon for optical lenses etc.
I now updated the module with the suggestions from wasd. Edge-plit was replaced by split normals. Apparently edg-esplit is now deprecated anyways...
Furthermore, by request of a GitHub-issue, I already included a first version of aspheric surfaces on lenses, and mirrors can now include a central hole along the main axis.
As a funny side-effect, which I noticed while testing, you can use it to model syringe-needles
Furthermore, by request of a GitHub-issue, I already included a first version of aspheric surfaces on lenses, and mirrors can now include a central hole along the main axis.
As a funny side-effect, which I noticed while testing, you can use it to model syringe-needles
Re: Little Addon for optical lenses etc.
You can also make earth (and other spherical bodies) surface with this. I also think that option to make lens horizontal (with it's axis along z axis), square-shaped and square-divided would be great addition!
With just a few clicks I made this disk section of earth, with 20 km diameter.
Look, with camera at 0.5 meter above the ground, the truck that's 6 km from camera is half beneath horizon! Other one, which is closer isn't beneath.
With just a few clicks I made this disk section of earth, with 20 km diameter.
Look, with camera at 0.5 meter above the ground, the truck that's 6 km from camera is half beneath horizon! Other one, which is closer isn't beneath.
CPU Bidir + Metropolis | Core i5-4570
Re: Little Addon for optical lenses etc.
The rotation (and translation) parameters are currently missing from when I switched to a custom draw method, but that is provided by Blender and will be back.
By square shaped, do you mean like, for example, a single element of such a micro-lens array?
https://www.nilt.com/wp-content/uploads ... m137tu.jpg
And square-divided? Do you mean D-shaped lenses like in this cross-section model? I already have plans to implement those. The truck behind the horizon is a nice touch You could take a ship instead and add it to the sunset scene from the other thread
Re: Little Addon for optical lenses etc.
I mean like cut-out of uv-sphere. Maybe I'll do it myself.
CPU Bidir + Metropolis | Core i5-4570
Re: Little Addon for optical lenses etc.
I added a square lens. Have a look if thats what you wanted.
It is perfectly square now, so not exactly like a u,v-sphere cutout, which would deviate a lot for strongly curved surfaces.
However, the square surfaces at the moment are not perfectly defined, because I used quadrilaterals, and in this case not all vertices lie in the same plane. I will see what is the most elegant way to define surfaces elements... Shouldn't be much of a problem for most use cases though.
On a side note, I also fixed a problem with the mirrors for focal lengths < 1.
It is perfectly square now, so not exactly like a u,v-sphere cutout, which would deviate a lot for strongly curved surfaces.
However, the square surfaces at the moment are not perfectly defined, because I used quadrilaterals, and in this case not all vertices lie in the same plane. I will see what is the most elegant way to define surfaces elements... Shouldn't be much of a problem for most use cases though.
On a side note, I also fixed a problem with the mirrors for focal lengths < 1.
Re: Little Addon for optical lenses etc.
I now optimized the mesh geometry of the square lens, and added a cross-section view option (D-shape) to the regular lens.