The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.
#71509 by Mark F. Madura
Fri May 19, 2017 8:24 am
Hello David,

I've been experimenting with your dhShadow BETA macro. Simple models appear to work as expected as show in this image. However, I've tried to create shadows of a few exploded furniture symbols. Even the simplest ones hang the process. I'll send you my test file via e-mail so you can try it yourself. Otherwise, it looks good so far.

MFM

dhShadowTest.jpg
dhShadow Test
#71512 by dhs
Fri May 19, 2017 7:38 pm
Thanks Mark,
Always glad to get feedback.
I think you were testing with an early version (0.1 or 0.2).
I am now up to ver 0.6 which I have tested with your model and the furniture does appear to cast shadows ok with the 0.6 version.

I noticed that you had added solid fill to the shadows you created, which seems like a good idea. The 0.6 version creates the shadows as symbols, which means that you won't be able to add solid fill to them once created. The 0.6 version does allow a hatch to be added to the created shadows, but I am looking at adding a solid fill option within the macro and will advise once this is available.

The rationale for adding the shadows as symbols is that (although the macro only handles polygons currently) I may get a shadow with more than 36 sides for some entity types or for polygon shadows that are clipped to the shadow surface. I am therefore now creating the shadows as poylines. As polylines are a 2D entity type I need to add them to a symbol so that I can apply a modelling matrix to rotate them into the correct position for shadow surfaces that are not horizontal. I also add all the separate shadow polylines to a single symbol so that they can be treated as a single entity which seemed a good idea to me, and also give the symbol an informative name.
Any comments on the above would also be welcome.

I have only had a handful of people do any beta testing on this macro, so would appreciate anybody else who would like to download and try the macro out. It can be downloaded from dropbox at https://www.dropbox.com/s/vlbi4ew7ti4gm ... o.zip?dl=0 (the zip file also contains the source code for anybody interested in looking at that).

Regards,
David
#71514 by dhs
Sat May 20, 2017 6:07 am
I have added a solid fill option to the macro, and the new version is available on dropbox.

Shame that solid fill only works on horizontal surfaces, so the fills created by the macro will only be correct in plan view.
#71515 by dhs
Sat May 20, 2017 5:24 pm
Regarding my last posts, I've discovered that some of my comments were wrong!
I had not used solid fill previously, but in my testing (using the UI, before I had written any related code) I was unable to fill some polygons in my test drawing. I realised that the ones that would not display fill were those that were not horizontal, so came to the conclusion that you could only solid fill would only display for horizontal entitites.
This morning I was fiddling with a couple of things and discovered that you could fill polylines at any orientation. So I need to update my macro code to render filled shadows at the correct orientation (which would actually have been a lot easier in the first place!)
On the subject of polylines, my recollection was that these were 2d entities. This is obviously also wrong, as I have been able to rotate polylines around the x & y axis (and any fill and associative hatch rotate correctly with them).
I still like the idea of creating the shadows as symbols, but part of my rationale for doing so is in fact not valid as the polylines can be rotated without being placed in a symbol (although the non-associated hatch I am using cannot be rotated unless I convert all the hatch lines to 3d lines ).
Any comments appreciated.

I also discovered what I consider a bug: if you hatch a rotated polyline using non-associated hatch, the the hatch lines are created in the wrong position. This is not overly surprising given the 2d nature of the hatch lines, but depending how the polyline has been rotated the hatch may not even be near the actual rotated position of the polyline. This leads me to expect that the polyline entity has a modelling matrix in its definition that is not documented in the DCAL manual?
#71530 by Mark Bell
Mon May 22, 2017 5:28 am
Hello Dave,

Welcome back to DataCAD~! I bought your shadow macro back in the early 90's. I gave your current one a go and got a crash on first attempt, though I quickly entered 90 and 90 for the sun settings. When I entered different values the second time it worked.
052217a.jpg

Have you used the inbuilt Sunshader yet?
#71534 by dhs
Mon May 22, 2017 2:20 pm
Thanks Mark,
I am unable to reproduce your error, so I expect that it had to do with something that was not initialised properly rather than the values you entered. I will look into it a bit further (the actual error codes don't mean anything to me ... don't know if Dave or Mark can offer any insight into them if they read this).

I have had a quick look at the sun shader. To be quite honest I was not able to get the results I wanted with it (probably due to my lack of perseverance rather than a shortcoming with the shader itself). I had a brief email discussion with Nick Pyner at the time and he was of the opinion that there was still a case for casting shadows as vector entities rather than bitmaps. Whilst I can see that the bitmapped process will satisfy many users, it was more of a challenge to create a new shadow macro than it was to fulfil any particular need (although I do hope that some people might see a use for it ... Nick probably won't as he already has (and is still using) dhShadow).

As I recall you were located in Darwin in the 90's when you purchased dhShadow. Hope things are working well for you on the Sunshine Coast now.

Regards,
David
#71535 by Mark F. Madura
Mon May 22, 2017 3:02 pm
Hi David,

In the Sun Shader, at the bottom of the Shadow Study pull-down menu, you'll find a *Shadow Diagram* option.
You can use this option to generate a vector outline for the shadow that is currently being cast.
You'll be prompted to save the results to your DataCAD drawing.

MFM
#71540 by dhs
Mon May 22, 2017 4:51 pm
Thanks Mark,
I notice that it is still a work in progress, and am a bit confused as to the ground plane settings ... it seems to only allow a horizontal plane at a specified z (base of model or specific height) ?

I managed to export vectors to my drawing once, but have not been able to do it again. Not sure if this is a symptom of the 'work in progress' status or if I am doing something differently (it comes up with the generating outline progress bar and then prompts me to save to drawing, but there does not appear to be anything added to the drawing). I am actually using the Shadow_Test drawing you sent me. I generated the outlines once, then deleted the results and have not been able to generate outlines successfully again.
#71544 by Mark Bell
Mon May 22, 2017 6:11 pm
Hello Dave,

Yes, enjoying the new lifestyle down here on the Sunshine Coast - I'm actually located up in Hinterland area patiently waiting for some projects to kick off....
#71568 by Mark F. Madura
Wed May 24, 2017 7:30 am
Hi David,

I had a few moments to look at your latest build. You've made some nice refinements in 0.8.2.

- I'm not able to add entities to SelSet1.

- I get a diagnostic fault when I try to use the Sun's Eye View option in my test file.
dhShadow_Diagnostic_Fault.jpg
Sun's Eye View Diagnostic Fault
dhShadow_Diagnostic_Fault.jpg (44.4 KiB) Viewed 16054 times


- The Outline Color option is a bit confusing. I assume it's either the current color or the same as the fill color?

Nice Work!

MFM
#71589 by dhs
Thu May 25, 2017 3:44 pm
Thanks for your feedback Mark.

I have fixed the basic coding errors that were leading to your crash and selection set problems (attempting to get the extents of some uninitialized entities was causing the crash, selection set problem was simply me checking for sel set num > 0 instead of >=0).
The new version is now available on drop box (https://www.dropbox.com/s/vlbi4ew7ti4gmfy/ShadowMacro.zip?dl=0)

I agree that the colour options could be confusing when using fill, as the fill colour effectively over-rode the other settings and this was not all that obvious. I have removed the ability to set a colour for the fill, and it now always takes on the colour specified for the outline on the macro main menu. There are 3 options for outline on the main menu:

S3 Spec Clr : This option draws the shadows in the selected colour regardless of anything else
S4 Curr Clr : This option draws the shadows in the colour assigned to the layer the are being drawn on (not necessarily the current layer)
S5 Ent Clr : This option draws each shadow in the same colour as the entity the shadow belongs to. There is an 'anomaly of sorts when processing polygon voids: if the ply used to create the void was a different colour to the ply the void was added to then DataCAD still displays the void in the colour of the master ply, but the shadow macro picks up the colour of the original entity used to create the void. This should not be hard to fix, but I have not gotten around to it yet.

Regards,
David H
#71851 by dhs
Fri Jul 14, 2017 2:36 am
Thanks Mark,

The final 1.0 version of the macro is ready and I hope to 'release' it shortly (I'm travelling at the moment so don't have the time I normally would to get it all up on the website). But for those that happen to read this post, the macro can be downloaded from the following link:

http://www.dhsoftware.com.au/downloads/ShadowInstall.exe

I am interested to hear of any issues anybody has with the download & install. Initially Windows was giving a warning that seemed to indicate that it was likely to be a virus or spyware etc, but I think that is resolved now. Chrome was still giving a warning about 'uncommonly downloaded' software last time I tried, but their guidelines seem to indicate that this should be lifted automatically once Google safe browsing verifies that it is benign.

Regards,
David H.

Who is online

Users browsing this forum: No registered users and 8 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for Architects Since 1984