Re: OpenSCAD Digest, Vol 14, Issue 17

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

stonysmith
Two things:
1) Has anyone done a recent compile for Windows?
2) Does anyone other than me think that it'd be handy to have a special variable $pi set to the obvious constant value?
Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

Giles Bathgate-2

2) Yes except it should be tau ;)

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

kintel
Administrator
In reply to this post by stonysmith
On Feb 4, 2011, at 09:28 AM, Stony Smith wrote:

> 1) Has anyone done a recent compile for Windows?

It's being worked on. The current setup (mingw-based) was a bit unconventional and hard to maintain from a Windows perspective, so it will now be buildable with the Visual C++ compiler. Once that is done, there will be a new release.

> 2) Does anyone other than me think that it'd be handy to have a special variable $pi set to the obvious constant value?

Good idea. I've added it to the wishlist (aka. TODO.txt).

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

Giles Bathgate-2
> Good idea. I've added it to the wishlist (aka. TODO.txt).

Its a two line patch:

http://gitorious.org/openscad/openscad/commits/pi-variable

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

Giles Bathgate-2
BTW regarding TODO.txt openscad already has a true and false keyword!

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

kintel
Administrator
In reply to this post by Giles Bathgate-2
On Feb 4, 2011, at 21:08 PM, Giles Bathgate wrote:
> Its a two line patch:
>
> http://gitorious.org/openscad/openscad/commits/pi-variable
>
$pi somehow implies a variable - a constant would IMO be better.
Perhaps just use PI.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

kintel
Administrator
In reply to this post by Giles Bathgate-2
On Feb 4, 2011, at 21:12 PM, Giles Bathgate wrote:

> BTW regarding TODO.txt openscad already has a true and false keyword!
>
Evidently, the TODO.txt is not too updated :/

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

Giles Bathgate-2
In reply to this post by kintel
> $pi somehow implies a variable - a constant would IMO be better.
> Perhaps just use PI.

Thats slightly more tricky then since openscad currently doesn't
support the concept of constants.

I have pushed a proof of concept for builtin constants (which
currently only includes PI) to the same
branch http://gitorious.org/openscad/openscad/commits/pi-variable

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

kintel
Administrator
In reply to this post by Giles Bathgate-2
On Feb 4, 2011, at 21:12 PM, Giles Bathgate wrote:

> BTW regarding TODO.txt openscad already has a true and false keyword!
>
I think I remember why I put that there: I'd like expressions returning integers to be evaluated as a boolean.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

kintel
Administrator
In reply to this post by Giles Bathgate-2
On Feb 5, 2011, at 16:54 PM, Giles Bathgate wrote:
>
> I have pushed a proof of concept for builtin constants (which
> currently only includes PI) to the same
> branch http://gitorious.org/openscad/openscad/commits/pi-variable
>
Looks good - I suggest applying it to the visitor branch to let the concept mature.
I'm make the warning an error btw.

Alternatively, this could be done in the parser, but that a bit too deep IMO, and we don't have a preprocessor : /

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

Giles Bathgate-2
> Looks good - I suggest applying it to the visitor branch to let the concept mature.
> I'm make the warning an error btw.
>
> Alternatively, this could be done in the parser, but that a bit too deep IMO, and we don't have a preprocessor : /

Ok, I have rebased it onto the visitor branch and pushed it into a
pi-constant branch

http://gitorious.org/openscad/openscad/commits/pi-constant

This should make it easy for you to merge or cherry pick onto your
visitor branch

Regards

Giles.

Reply | Threaded
Open this post in threaded view
|

Re: OpenSCAD Digest, Vol 14, Issue 17

kintel
Administrator
On Feb 5, 2011, at 17:43 PM, Giles Bathgate wrote:
>
> http://gitorious.org/openscad/openscad/commits/pi-constant
>
> This should make it easy for you to merge or cherry pick onto your
> visitor branch
>
Applied. Thanks!

 -Marius