Graphscad
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Graphscad

Graphscad : The Graphic Nodal Editor for OpenScad
 
HomeLatest imagesSearchRegisterLog in

 

 Use of global setting variable $fn inconsistant

Go down 
2 posters
AuthorMessage
Kpacnaja_Shapotshka




Messages : 8
Date d'inscription : 2017-02-11

Use of global setting variable $fn inconsistant Empty
PostSubject: Use of global setting variable $fn inconsistant   Use of global setting variable $fn inconsistant Icon_minitimeMon 13 Feb - 1:10

Hi,

I played around with the switchcasedemo, inserted a globalsettings node, set the $fn to 50 and noticed some quirks.

I expected the global setting $fn being used by the cylinder, sphere and roundcube when the local $fn is omitted/empty.
That was not the case.
When the local $fn was empty with a sphere or cylinder, the local $fn was implicitly set to be 16+1*3.14116.
When the local $fn was empty with the roundcube, following code was generated for the eight hulled corner spheres:

    translate([-(((1)/2)-0.1),-(((1)/2)-0.1),-(((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([-(((1)/2)-0.1),-(((1)/2)-0.1), (((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([-(((1)/2)-0.1), (((1)/2)-0.1),-(((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([-(((1)/2)-0.1), (((1)/2)-0.1), (((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([ (((1)/2)-0.1),-(((1)/2)-0.1),-(((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([ (((1)/2)-0.1),-(((1)/2)-0.1), (((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([ (((1)/2)-0.1), (((1)/2)-0.1),-(((1)/2)-0.1)]) sphere(r=0.1,$fn=);
    translate([ (((1)/2)-0.1), (((1)/2)-0.1), (((1)/2)-0.1)]) sphere(r=0.1,$fn=);

This leads to a parser error.

I would suggest the following:
1. When the local $fn  is not set (empty) in these nodes and a global $fn is set, dont generate code for a local $fn. Then the global setting is used for these objects.
2. When the local $fn  is not set (empty) in these nodes and a global $fn is also not set, generate code for a implicitly set local $fn for all of these objects.
Then we have proper looking spheres, cylinders and roundcubes, not etchy ones. And we dont get parser errors.

This may also apply  for other advanced  rounded objects.

Kpacnaja_Shapotshka
Back to top Go down
Admin
Admin



Messages : 59
Date d'inscription : 2017-01-08

Use of global setting variable $fn inconsistant Empty
PostSubject: Re: Use of global setting variable $fn inconsistant   Use of global setting variable $fn inconsistant Icon_minitimeMon 13 Feb - 22:20

you're perfectly right. will try to implement this. The complex thing is just knowing if global $fn was set by a global node... but it's possible.
Back to top Go down
https://graphscad.forumotion.com
Admin
Admin



Messages : 59
Date d'inscription : 2017-01-08

Use of global setting variable $fn inconsistant Empty
PostSubject: Re: Use of global setting variable $fn inconsistant   Use of global setting variable $fn inconsistant Icon_minitimeTue 14 Feb - 0:13

fixed. will be available in v1.0.7. example fn_orveridetest.scad
Back to top Go down
https://graphscad.forumotion.com
Sponsored content





Use of global setting variable $fn inconsistant Empty
PostSubject: Re: Use of global setting variable $fn inconsistant   Use of global setting variable $fn inconsistant Icon_minitime

Back to top Go down
 
Use of global setting variable $fn inconsistant
Back to top 
Page 1 of 1
 Similar topics
-
» Setting up a scene with camera position and view

Permissions in this forum:You cannot reply to topics in this forum
Graphscad :: Issues-
Jump to: