[Plugin] ShadowProjector v1.2 20111215

Re: [Plugin] ShadowProjector v1.2 20111215

Postby simon le bon » Thu Dec 15, 2011 6:42 pm

Because faces using a translucent material don't show normal shadows you can now use this tool to add a visible translucent 'gray' shadow-group face [with no edges] onto selected window-glass etc,






As it is, it's already a great tool dear TIG

Thank you so much to make SketchUp each day growing as a wonderful application

++simon
0
User avatar
simon le bon 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby derei » Mon Dec 19, 2011 1:06 pm

I can't use the plugin :( It crashes my model all the time. I made a magnifier glass and a ground plane (face) . I selected the face, that was oriented with front upwards (the shadow projected on front face), then ran the plugin. ... First time it made a grouped face over my selected one. Now it just crashes every time.
Model attached.
0
User avatar
derei 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Mon Dec 19, 2011 2:20 pm

It Bugsplats for me too. :? :cry:

It's a relatively small object and makes many tiny facets in the shadow that it needs to process.
Some complex shapes just have too much geometry.
I erased the unneeded coplanar edges which up the face count considerably!
Also made sure the forms were solids - tiny holes leak shadows - erased unwanted internal partitions and flaps...
The small detailing on the handle also makes some tiny facets when projected.
Lifting the handle up 1mm so it didn't touch the face [a single point of contact or tiny common facet seems to be awkward].
Making it 1000 bigger using Scale, simplifying the handle and putting the lens on an 'off' layer [you don't want it's shadow anyway ?] - I did get it to work eventually... BUT it took ages !

If I copy/paste your geometry into a new SKP I get an error fix now ? message about zero length edges - BUT it doesn't 'fix' within the SKP itself - weird...

This simplified version processes readily without problems.
Capture.PNG
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby sbpronh » Thu Dec 22, 2011 7:08 pm

Using this technic and some more :) creating anamorph art would be great!!!! url:
http://jrengozzi.wordpress.com/page/2/

Regards and thanks!
Harry
0
User avatar
sbpronh 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby Juantxo » Thu Feb 02, 2012 9:22 am

If someone is interested there is a similar shadow projector in skelion plugin.
You can project shadows at specific time, but over a range of time too, that's the main difference of the plugin.
I tried with the magnifier.skp test and it works.(Time calculation about a minut)
0
User avatar
Juantxo 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby morph » Sun Mar 11, 2012 2:48 pm

to TIG

I try to find the way to reduce the time of ShadowProjector plugin culation process after I found it take a long time when the number of calculated face up to 50 faces.

Now, I study in master degree and try to create plugin to retrieve shadow area from all day solar vector on glass face of building. When I try to put ShadowProjector algorithm to 10 loops solar vector, the time usage graph of 10 loops are not linear. It is parabola although the time usage graph in loop which use the .raytest function is linear.

Please suggestion.
0

morph 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Sun Mar 11, 2012 4:40 pm

Morph

The time it takes Sketchup to add objects to a context is not linear.
The more objects the slower it is, but as you have noticed it is almost 'exponential' so x2 objects takes x4 the time etc.
With relatively few objects this is not so noticeable - but the more objects the worse it gets.
Also the number of objects already in the context slows things up considerably... so perhaps compartmentalizing the results inside their own entities context - e.g. a group - might speed things up...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby morph » Wed Mar 14, 2012 5:26 pm

to TIG

Next idea I think I will try to use EntitiesObserver and EntityObserver to check face after first run calculation process (which take a long time) if face is not modified it will cut off from next calculation.

But after I read Google Developer Sketchup (https://developers.google.com/sketchup/ ... esobserver) it warn me that "WARNING: The methods of this observer fire in such a way that making changes to the model while inside of them is dangerous. If you experience sudden crashes, it could be because of this observer. A potential workaround is to use a ToolsObserver to watch what the user is doing instead."

Please recommend me for my idea.
0

morph 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby mra » Tue Jun 19, 2012 7:57 am

I can't seem to get this to work.

It works on one object on my scene, but crashes SketchUp if I attempt it on other objects (exploded or not, normals facing the right way).
0

mra 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Tue Jun 19, 2012 11:06 am

mra wrote:I can't seem to get this to work.
It works on one object on my scene, but crashes SketchUp if I attempt it on other objects (exploded or not, normals facing the right way).
How does it 'crash' ?
If you mean it becomes 'unresponsive' [aka a white-out], that doesn't mean it's crashed - it's just taking a long time to do all of the calculations needed - the complexity increases exponentially as everything has to be checked against everything else... :o

You do need to keep things as simplified as you can to ensure it completes within a reasonable time - e.g. use layers etc to hide unwanted objects, ensure the objects are not too complex - and remember that it's pointless casting shadows from [or onto] door-handles, leaves etc - it's to take shadows from block models onto block models etc - also many objects won't cast shadows if they are already within the 'umbra' of other objects, so exclude those from the calculations too...

If it's actually 'crashing' - as in a Bugsplat! - then what error messages do you get, if any :?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby the.pjt » Tue Jun 19, 2012 8:08 pm

I wish this features would be done by SU core ... not ruby .. :(

sorry for main developers .. if they had made a C++ API and compiled extensions .. or a open source program these tasks could be compute much faster ... :(

but .. thanks a lot dear TIG , ... this is incredible to simulate shadow system in ruby ... thanks for everything , I don't know what is your name and who you are .. man or woman ? , but thanks dear unknown TIG ... :)
0

the.pjt 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby tetsuyahishida » Thu Jun 21, 2012 7:43 am

TIG!

This plugin is wonderful. I'm now planning to make a plugin to export an hourly data of the shadow ratio.
And now checking the code of yours.
Since sketchup API doesn't have enough kind of shadow API,
it would very helpful if you could explain the algorithm to get the shadow.

Anyway thanks for your masterpiece.
0

tetsuyahishida 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Thu Jun 21, 2012 9:46 am

tetsuyahishida wrote:TIG!

This plugin is wonderful. I'm now planning to make a plugin to export an hourly data of the shadow ratio.
And now checking the code of yours.
Since sketchup API doesn't have enough kind of shadow API,
it would very helpful if you could explain the algorithm to get the shadow.

Anyway thanks for your masterpiece.

Read the .rb file's code to see how it works...
The sun has a 'direction' [to get the direction of the rays of sunlight we reverse that vector].
The selected faces are processed in turn - 'selected face'...
It finds the edges of all faces in the model or groups/instances that might shine onto that 'selected face'.
It extrudes these edges into a grouped 'tube' with a very long set of faces, which it then intersects with the 'selected face' and adds faces temporarily.
The tube is erased.
It then has a set of edges representing the outer limits of the 'selected face's' shadows; internal 'coplanar' edges are erased so it's as simple as possible.
Each 'shadow' group is formated as the options set, text added etc...
Obviously it's much more complicated than that [e.g. how to spot if there's a 'hole' in a face], but the principle is as stated...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby tetsuyahishida » Fri Jun 22, 2012 2:35 am

Wow now I got it.I guess that's the best way.

Thanks so much.

TIG wrote:
tetsuyahishida wrote:TIG!

Read the .rb file's code to see how it works...
The sun has a 'direction' [to get the direction of the rays of sunlight we reverse that vector].
The selected faces are processed in turn - 'selected face'...
It finds the edges of all faces in the model or groups/instances that might shine onto that 'selected face'.
It extrudes these edges into a grouped 'tube' with a very long set of faces, which it then intersects with the 'selected face' and adds faces temporarily.
The tube is erased.
It then has a set of edges representing the outer limits of the 'selected face's' shadows; internal 'coplanar' edges are erased so it's as simple as possible.
Each 'shadow' group is formated as the options set, text added etc...
Obviously it's much more complicated than that [e.g. how to spot if there's a 'hole' in a face], but the principle is as stated...
0

tetsuyahishida 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby Gonvaz » Fri Feb 15, 2013 11:11 am

I'm afraid I can't make it work. I select a face, then I click tools>ShadowProjector, select lines, or faces, etc. and nothing happens. I haven't been able to get any projection of any shadow.
0

Gonvaz 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Fri Feb 15, 2013 11:59 am

Gonvaz wrote:I'm afraid I can't make it work. I select a face, then I click tools>ShadowProjector, select lines, or faces, etc. and nothing happens. I haven't been able to get any projection of any shadow.
Any error messages if done with the Ruby Console open ? Can you post a simple example SKP etc...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby Gonvaz » Fri Feb 15, 2013 12:20 pm

I've been trying to make it work with the attached example.
Sometimes I get "You must preselect at least ONE suitably oriented face!".
When I get no message, I see no projections.
0

Gonvaz 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Fri Feb 15, 2013 4:21 pm

@Gonvaz
I am baffled what you are trying to do :?
This tool projects shadows from objects [essentially faces in the model/groups/components] onto preselected faces in the current context.
The SKP you attached seems to contain no faces whatsoever, so that is an immediate problem!
:shock:
Your 'pyramid' form is only edges, and whilst you can get edges to cast real-shadows, this tool only considers shadows from faces.
So, it should work given the right inputs - but I suggest you really need to reread and understand the tool's instructions... and then ask it to do what it's capable of, and you will get results.
:roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby Gonvaz » Mon Feb 18, 2013 10:42 am

I'm really sorry, TIG! I attached a wrong SKP. :oops:
Now I have attached the one I was using to test the plugin.
And I have found why I couldn't make it work: some of the faces were reversed.
I just selected the faces, right-click the selection and click "Reverse Faces".
It works perfectly!
Thanks!
0

Gonvaz 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby plot-paris » Fri May 24, 2013 4:03 pm

Hey TIG, just to let you know. The plugin produces a bug-splat with SketchUp 2013
0
User avatar
plot-paris 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Fri May 24, 2013 8:24 pm

plot-paris wrote:Hey TIG, just to let you know. The plugin produces a bug-splat with SketchUp 2013
It doesn't with me :?
Works just fine...
Do you have an example of a failing SKP you can provide?
Does it work in v8 but not in v13 ?
Do you also have other plugins loading that might conflict ?
More info please... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby plot-paris » Mon May 27, 2013 8:50 am

Ok, I did a bit of testing:

  • I got the plugin to work with SU 2013
  • I found that the new default character in the scene - Derrick - is causing the Bug Splat
    • I created a dynamic component with a hidden-toggle element myself. Everything worked fine...
    • I also created a component with fixed size. Worked fine too...

So, no Idea what the problem is. But Derrick is the clue :?

DerrickFucksItUp.skp
0
User avatar
plot-paris 
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby TIG » Mon May 27, 2013 10:18 am

Derrick makes a bugsplat in v8 AND v2013 when he's included in a shadow-projection !
Even when he's been exploded and hidden objects like the speech-bubble have been erased.

I think it's because sadly Derrick contains 26 edges that are <1mm long, and 3 of those are <=0.2mm, with the smallest being only 0.13mm long.
We all know [except apparently Trimble :roll: ] that 'tiny geometry' causes SketchUp several issues.
Shadows are 'projected' from the objects' face vertices, and if any two are almost coincident in 2d then SketchUp takes them to be coincident, and then the needed very small edge fails to be replicated in the shadow's outline set in the projection... and then it can't form a loop etc etc... Failure.

Also 2d face-me components might also cause problems with shadow-projections because their 'bounds' are shot to pieces by turning to face the camera etc...

I'll see if I can get Trimble to fix Derrick for the next maintenance release... :roll:

Meanwhile, avoid 2d face-me components like Derrick, in your shadow-projections... until further notice... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] ShadowProjector v1.2 20111215

Postby plot-paris » Mon May 27, 2013 11:12 am

ah, I see. Yes, usually I don't keep Derrick in my scenes. But unfortunately I did when trying your (very useful) plugin... :roll:
0
User avatar
plot-paris 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

Previous


 

Return to Plugins

Who is online

Users browsing this forum: a5975200, ardy17, arto11, craigwise3000, G star, Google Bot and 4 guests

Visit our sponsors: