Search the Knowledge Base Report a bug
Post new topic   Reply to topic   printer-friendly view   .    ArchiCAD-Talk Forum Index >>> Libraries / Library Parts / GDL >>> Why doesn't my 2D poly calculation work?
View previous topic :: View next topic
Author Message
JGoode
Junior member
Junior member

Joined: 21 Apr 2017
Posts: 135
Location: Norwich

PostPosted: Tue Aug 08, 2017 1:22 pm    Post subject: Why doesn't my 2D poly calculation work? Reply with quote

I can't seem to work out why the calculations don't seem to be working as I think I might have used the same sort of calculation previously. Is there any reason why it is not changing the object at all?


Poly2_b help.jpg
 Description:
 Filesize:  244.38 KB
 Viewed:  46 Time(s)

Poly2_b help.jpg


Back to top
View user's profile Send private message    
Piotr Dobrowolski
Veteran member
Veteran member

Joined: 29 Oct 2003
Posts: 509
Location: Krakow - Poland

PostPosted: Tue Aug 08, 2017 4:36 pm    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Use put and get for polygons instead writing inline.
no of nodes will be depending on the command type NSP/3..4..5
(how many status type data after coords)
and the all points at the end of the _poly like command will be "get(nsp)"

Best Regards,
Piotr
Back to top
View user's profile Send private message Visit poster's website    
Barry Kelly
Moderator
Moderator

Joined: 28 Oct 2003
Posts: 5720
Location: Perth, Western Australia

PostPosted: Wed Aug 09, 2017 2:31 am    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Using PUT and GET for polygon nodes is great when the number of nodes is variable.
In a case like this where the number of nodes is fixed it really won't make any difference.

Are you saying that when you adjust the value of the 'rail_width' parameter that your object is not changing?
If so do a find and select for 'rail_width' in the master parameter and the first part of this 2D script to see if the value for that parameter is being set - overriding the parameter value.

Or possibly you are using a value for 'rail_width' that just doesn't make sense for the points you are plotting - i.e. value is too small?

Otherwise I don't understand what you mean by 'calculation' as all you have here is a polygon definition.

Barry.

_________________
Versions 6.5 to 21
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 7 64bit
Back to top
View user's profile Send private message    
JGoode
Junior member
Junior member

Joined: 21 Apr 2017
Posts: 135
Location: Norwich

PostPosted: Wed Aug 09, 2017 12:18 pm    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Barry Kelly wrote:

Otherwise I don't understand what you mean by 'calculation' as all you have here is a polygon definition.
The calculation that defines the points in the object as in [/code]rail_width/2-(rail_width/2-0.49*********)[/code]
All bits of the definition that included this didn't work so I was wondering if there was a reason why they wouldn't work. I have it working now anyway using a different method.
Back to top
View user's profile Send private message    
Piotr Dobrowolski
Veteran member
Veteran member

Joined: 29 Oct 2003
Posts: 509
Location: Krakow - Poland

PostPosted: Wed Aug 09, 2017 2:49 pm    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Ok what is the error?
Polygon does not show? or shows incorrectly? You get error message (what message)?

Best Regards,
Piotr
Back to top
View user's profile Send private message Visit poster's website    
Bruce
Active member
Active member

Joined: 20 Jul 2005
Posts: 433
Location: Auckland New Zealand

PostPosted: Thu Aug 10, 2017 2:18 am    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Have you checked to make sure you haven't accidentally created a 2D symbol, as from memory this will stop the 2D script from running?
_________________
Bruce Walker
www.brucepwalker.com
https://www.mindmeister.com/65450406

AC20 6005 AUS Full & AC 21 3009 NZE Full | Win 10 Pro 64 | Intel i7-7700HQ 2.80GHz | 16 Gb RAM
NVIDIA GeForce GTX 1060 8Mb
Back to top
View user's profile Send private message    
Barry Kelly
Moderator
Moderator

Joined: 28 Oct 2003
Posts: 5720
Location: Perth, Western Australia

PostPosted: Thu Aug 10, 2017 3:00 am    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Bruce wrote:
Have you checked to make sure you haven't accidentally created a 2D symbol, as from memory this will stop the 2D script from running?


If there is a 2D script this should override anything drawn in the 2D symbol window.
Unless it is called as a FRAGMENT.

Barry.

_________________
Versions 6.5 to 21
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 7 64bit
Back to top
View user's profile Send private message    
Barry Kelly
Moderator
Moderator

Joined: 28 Oct 2003
Posts: 5720
Location: Perth, Western Australia

PostPosted: Thu Aug 10, 2017 3:03 am    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

JGoode wrote:
Barry Kelly wrote:

Otherwise I don't understand what you mean by 'calculation' as all you have here is a polygon definition.
The calculation that defines the points in the object as in [/code]rail_width/2-(rail_width/2-0.49*********)[/code]
All bits of the definition that included this didn't work so I was wondering if there was a reason why they wouldn't work. I have it working now anyway using a different method.


I don't see anything wrong with your script.
So long as you are adjusting the parameter for 'rail_width' your object should adjust.
But as I said be sure this parameter is not being set to a fixed value before the polygon or in the master or parameter script.

It is very hard to tell what is happening without seeing the entire object scripts.

Barry.

_________________
Versions 6.5 to 21
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 7 64bit
Back to top
View user's profile Send private message    
allanp
New member
New member

Joined: 14 Apr 2004
Posts: 34
Location: Australia

PostPosted: Fri Aug 11, 2017 5:54 am    Post subject: Re: Why doesn't my 2D poly calculation work? Reply with quote

Hi,

it appears like you are trying to draw flanges, connections to the wall?

assuming that 0.49266 is a big number, or spacing between....that may be where you are going wrong....as you are canceling out your Rail_width/2 by adding it then minusing it at that point you are using that big number...

this looks like code from a projection with the facets of a curve turned into code...when it should be just the true size...

choosing a simple Poly2_B script(not fill distortions)
4 points, plus closing point (5 in total)(-1 to close a poly at end)


Flange_Depth = 0.012
Flange_Diameter = 0.04225

for the origin it would be
Poly2_b 5, 3, gs_fill_pen, gs_back_pen,
-Flange_Diameter/2, 0, 1,
-Flange_Diameter/2, Flange_Depth, 1,
Flange_Diameter/2, Flange_Depth, 1,
Flange_Diameter/2, 0, 1,
-Flange_Diameter/2, 0, -1



for the middle connection it would be...
Poly2_b 5, 3, gs_fill_pen, gs_back_pen,
Rail_width/2-Flange_Diameter/2, 0, 1,
Rail_width/2-Flange_Diameter/2, Flange_Depth, 1,
Rail_width/2+Flange_Diameter/2, Flange_Depth, 1,
Rail_width/2+Flange_Diameter/2, 0, 1,
Rail_width/2-Flange_Diameter/2, 0, -1

for the far end it would be...
Poly2_b 5, 3, gs_fill_pen, gs_back_pen,
Rail_width-Flange_Diameter/2, 0, 1,
Rail_width-Flange_Diameter/2, Flange_Depth, 1,
Rail_width+Flange_Diameter/2, Flange_Depth, 1,
Rail_width+Flange_Diameter/2, 0, 1,
Rail_width-Flange_Diameter/2, 0, -1


39 points is a lot for a simple shape....especially when the y-value does not change (only 2 values)

_________________
____________
Allan P.
Archicad 4.55 to 21
GDL from Blocks to Nurbs
Apple from Mac Classic to iMac
Windows from 3.11 to Windows 10
Back to top
View user's profile Send private message    
Display posts from previous:   
View previous topic :: View next topic
Post new topic   Reply to topic   printer-friendly view       ArchiCAD-Talk Forum Index >>> Libraries / Library Parts / GDL >>> Why doesn't my 2D poly calculation work? All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB 2001, 2005 phpBB Group
Copyright 2012 - Graphisoft SE. All rights reserved worldwide. Terms of Use | Privacy Policy