Solar diagrams

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Solar diagrams

Post by triplus »

Now that i guess is a proper CAD shadow. As it likely can be dimensioned or sent to CNC machine. ;)
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Solar diagrams

Post by pablogil »

microelly2 wrote:shadows on a transparent background
Looking really good!
Just one question: are you using 2 lights sources? I see that you have 2 shadows overlapping each other and the common part is darker... this is nice if you have 2 light sources but "unrealistic" if you just have one light source.

When will be able to play with it? :D ;)
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Solar diagrams

Post by microelly2 »

pablogil wrote:
microelly2 wrote:shadows on a transparent background
Looking really good!
Just one question: are you using 2 lights sources? I see that you have 2 shadows overlapping each other and the common part is darker... this is nice if you have 2 light sources but "unrealistic" if you just have one light source.

When will be able to play with it? :D ;)
The background body is a transparent L-profile. I calculate the shadow on each face, so you see for any part two shadows.
Having two shadow faces I can calculate the shadow room inside the background body as a loft (of the both shadow faces) or helos like in Blender:
Image

Here my example with first helos
bp_247.png
bp_247.png (58.16 KiB) Viewed 3353 times
(The light source is the red sphere)

I have tested the case of makeParallelProjection/sun light and it will work too.
And of course we can use multiple lights to get penumbra and core shadows effects for indoor lightning
At the moment its to much hard coded in my script for publishing, I hope to get a testcase this weekend.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Solar diagrams

Post by microelly2 »

bp_249.png
bp_249.png (35.82 KiB) Viewed 3303 times
https://www.youtube.com/watch?v=Xkts91Y ... e=youtu.be
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Solar diagrams

Post by microelly2 »

The script and the model I used in the video is now here:
http://freecadbuch.de/doku.php?id=blog: ... bbildungen

For creating the shadow space I still look for a way to connect the corresponding edges for two projections.
At the moment it is hard coded for this case of the windows
The methods still not work for curves but only for planar faces and straight edges.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Solar diagrams

Post by yorik »

Excellent microelly!

I also made some progresses... These two attached files can be inserted into a FreeCAD document and they work (the spotlight only works with the nvidia chip for me, not with the intel. Something to do with the 3D driver probably). The good thing is that you can have shadows without modifying the FreeCAD 3D view at all, because I tried encapsulating the whole contents of the 3D view into a SoShadowGroup, but it gives a lot of artifacts everywhere, specially in the sketcher.
Attachments
dirlight.iv
(897 Bytes) Downloaded 129 times
spotlight.iv
(1.32 KiB) Downloaded 113 times
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Solar diagrams

Post by pablogil »

microelly2 wrote:The script and the model I used in the video is now here:
http://freecadbuch.de/doku.php?id=blog: ... bbildungen

For creating the shadow space I still look for a way to connect the corresponding edges for two projections.
At the moment it is hard coded for this case of the windows
The methods still not work for curves but only for planar faces and straight edges.
Really cool tests and progress. FYI they work perfectly on macOS ;)
yorik wrote:I also made some progresses... These two attached files can be inserted into a FreeCAD document and they work (the spotlight only works with the nvidia chip for me, not with the intel. Something to do with the 3D driver probably). The good thing is that you can have shadows without modifying the FreeCAD 3D view at all, because I tried encapsulating the whole contents of the 3D view into a SoShadowGroup, but it gives a lot of artifacts everywhere, specially in the sketcher.
Also very nice improvements, the spotlight test works perfectly on my Macbook Pro but the dirlight has no effect on my system...
Any of them are able to cast shadows to actual FreeCAD geometry but I guess you already know it...
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Solar diagrams

Post by microelly2 »

Great Yorik,
So we have a fast way to render and a way to get models for technical drawings.

today I have tested to make the perspective projection of a 3D nurbs and its iso grid to the plane
all derived models are vector graphics data (bsplines)

https://www.youtube.com/watch?v=dub8nHiOlfk

it's still not a porsche (but for me the proof that it will be possible with FreeCAD not so far :D )
Attachments
bp_256.png
bp_256.png (71.69 KiB) Viewed 3224 times
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Solar diagrams

Post by microelly2 »

pablogil wrote: Also very nice improvements, the spotlight test works perfectly on my Macbook Pro but the dirlight has no effect on my system...
Any of them are able to cast shadows to actual FreeCAD geometry but I guess you already know it...
For me dirlight works, and for the spotlight I call santa claus to get another hardware.
User avatar
saso
Veteran
Posts: 1920
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: Solar diagrams

Post by saso »

Very nice progress on both approaches microelly and yorik! For some fake shadows to make the drawings just a bit more interesting to look at microellys method however does seem to require some effort, both to code it and then also for the user, but the method should be great and very useful for many different types of projection calculations...

About yoriks examples, I have tested them on a few computers, all of them were quite basic and older computers and all the examples worked on all of them. This machines were all Windows systems, one of them had Intel graphic and other were Nvidia. I will hopefully be able to test it on some more machines in the next days :)

I am adding an image of all the three tests, so that we have a clear reference what we should see. First one is yoriks model house with shadows, this one was actually quite confusing for me at first because in the beginning all I saw was just the rectangle that represents the ground, it did look like some light is shining on it and it took me quite a long time before I realized that to see the model of the house I first have to activate the Mesh Design WB and only then import this test file. The other two examples worked normally from the start, as can be seen on the image, one has small red cubes with shadow and the last one is actually an animation where the objects are moving and casting shadows...

So if anyone else will test this, it might be good to report some graphic card model and drivers version for those cases that are not working.
Untitled.png
Untitled.png (123.47 KiB) Viewed 3131 times
Hopefully it will be possible to get this working, I see it as an option to temporary turn on shadows (can be fake shadows without the proper sun position), of course if it can be later also used for real shadow/sun studies it would be great. Also I guess it might be possible to use it in TechDraw, if not directly then maybe as saved raster images :?:
Post Reply