3 different experimental patches for viewport

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

3 different experimental patches for viewport

donbright
Dear OpenSCAD

I am interested in hearing comments on these three different ways to
implement a viewport in OpenSCAD.

The first is as a module, the second is as a function, and the third
is as 'special variables'. The diffs for these patches can be viewed
at these three URLs:

https://github.com/donbright/openscad/compare/viewportmodule
https://github.com/donbright/openscad/compare/viewportfunc
https://github.com/donbright/openscad/compare/viewportvariables

Each works basically the same way. There is a 'starting viewport',
which alters the viewport only on the first compilation of the
session. There is also an 'animation viewport' which alters the
viewport only during animation.

The syntax for the function-version and module-version is as follows:

starting_viewport(distance=50,translation=[0,0,0],rotation=[35,0,25]);
animation_viewport(rotz=$t*360);

The syntax for the 'special variables' version is as follows:

$starting_viewport_distance = 50;
$starting_viewport_translation = [0,0,0];
$starting_viewport_rotation = [35,0,25];
$animation_viewport_rotz = $t * 360;

An animation of Example17 using viewports is here:
http://www.youtube.com/watch?v=prcjlJduc0s

Here is the complete parameter list: distance, translation, rotation,
transx, transy, transz, rotx, roty, & rotz. The transx &etc parameters
allow the user to modify one variable without modifying the others;
for example during an animation of rotz, you can still rotate the
model in x & y with the mouse.

Previous mailing list discussions are here:

http://rocklinux.net/pipermail/openscad/2011-March/thread.html#942
http://rocklinux.net/pipermail/openscad/2011-July/thread.html

Thank you

-DB

Reply | Threaded
Open this post in threaded view
|

Re: 3 different experimental patches for viewport

Giles Bathgate-2

Hi Don.

Maybe I have missed something but why does there need to be both a start viewport and animation viewport. Can you not just change the viewport relative to a start point?

Anyway I prefer the special variables version ;)

Regards

Giles

On 13 Jul 2011 19:02, "Don Bright" <[hidden email]> wrote:
> Dear OpenSCAD
>
> I am interested in hearing comments on these three different ways to
> implement a viewport in OpenSCAD.
>
> The first is as a module, the second is as a function, and the third
> is as 'special variables'. The diffs for these patches can be viewed
> at these three URLs:
>
> https://github.com/donbright/openscad/compare/viewportmodule
> https://github.com/donbright/openscad/compare/viewportfunc
> https://github.com/donbright/openscad/compare/viewportvariables
>
> Each works basically the same way. There is a 'starting viewport',
> which alters the viewport only on the first compilation of the
> session. There is also an 'animation viewport' which alters the
> viewport only during animation.
>
> The syntax for the function-version and module-version is as follows:
>
> starting_viewport(distance=50,translation=[0,0,0],rotation=[35,0,25]);
> animation_viewport(rotz=$t*360);
>
> The syntax for the 'special variables' version is as follows:
>
> $starting_viewport_distance = 50;
> $starting_viewport_translation = [0,0,0];
> $starting_viewport_rotation = [35,0,25];
> $animation_viewport_rotz = $t * 360;
>
> An animation of Example17 using viewports is here:
> http://www.youtube.com/watch?v=prcjlJduc0s
>
> Here is the complete parameter list: distance, translation, rotation,
> transx, transy, transz, rotx, roty, & rotz. The transx &etc parameters
> allow the user to modify one variable without modifying the others;
> for example during an animation of rotz, you can still rotate the
> model in x & y with the mouse.
>
> Previous mailing list discussions are here:
>
> http://rocklinux.net/pipermail/openscad/2011-March/thread.html#942
> http://rocklinux.net/pipermail/openscad/2011-July/thread.html
>
> Thank you
>
> -DB
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
Reply | Threaded
Open this post in threaded view
|

Re: 3 different experimental patches for viewport

donbright
Because I don't want it to change the viewport while I am working,
after every compilation. I only want it to change the viewport on the
first time I load and compile a model during a session
(starting_viewport), or during animation (animation_viewport).
Otherwise I want it to leave the viewport alone and let me control it
manually with the mouse. Thanks.

-DB


On Wed, Jul 13, 2011 at 1:35 PM, Giles Bathgate
<[hidden email]> wrote:

> Hi Don.
>
> Maybe I have missed something but why does there need to be both a start
> viewport and animation viewport. Can you not just change the viewport
> relative to a start point?
>
> Anyway I prefer the special variables version ;)
>
> Regards
>
> Giles
>
> On 13 Jul 2011 19:02, "Don Bright" <[hidden email]> wrote:
>> Dear OpenSCAD
>>
>> I am interested in hearing comments on these three different ways to
>> implement a viewport in OpenSCAD.
>>
>> The first is as a module, the second is as a function, and the third
>> is as 'special variables'. The diffs for these patches can be viewed
>> at these three URLs:
>>
>> https://github.com/donbright/openscad/compare/viewportmodule
>> https://github.com/donbright/openscad/compare/viewportfunc
>> https://github.com/donbright/openscad/compare/viewportvariables
>>
>> Each works basically the same way. There is a 'starting viewport',
>> which alters the viewport only on the first compilation of the
>> session. There is also an 'animation viewport' which alters the
>> viewport only during animation.
>>
>> The syntax for the function-version and module-version is as follows:
>>
>> starting_viewport(distance=50,translation=[0,0,0],rotation=[35,0,25]);
>> animation_viewport(rotz=$t*360);
>>
>> The syntax for the 'special variables' version is as follows:
>>
>> $starting_viewport_distance = 50;
>> $starting_viewport_translation = [0,0,0];
>> $starting_viewport_rotation = [35,0,25];
>> $animation_viewport_rotz = $t * 360;
>>
>> An animation of Example17 using viewports is here:
>> http://www.youtube.com/watch?v=prcjlJduc0s
>>
>> Here is the complete parameter list: distance, translation, rotation,
>> transx, transy, transz, rotx, roty, & rotz. The transx &etc parameters
>> allow the user to modify one variable without modifying the others;
>> for example during an animation of rotz, you can still rotate the
>> model in x & y with the mouse.
>>
>> Previous mailing list discussions are here:
>>
>> http://rocklinux.net/pipermail/openscad/2011-March/thread.html#942
>> http://rocklinux.net/pipermail/openscad/2011-July/thread.html
>>
>> Thank you
>>
>> -DB
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 3 different experimental patches for viewport

Giles Bathgate-2

On 13 Jul 2011 20:43, "Don Bright" <[hidden email]> wrote:

> Because I don't want it to change the viewport while I am working,
> after every compilation. I only want it to change the viewport on the
> first time I load and compile a model during a session
> (starting_viewport), or during animation (animation_viewport).
> Otherwise I want it to leave the viewport alone and let me control it
> manually with the mouse. Thanks.

This gives me an idea which is complimentary to your patch. In the view menu currently there are options to set the viewport to one of Top, Bottom, Left Right, etc. If there were two more options in there "Set Default Viewport", and "Default Ctrl+O", the first of which could open a simple GUI for setting the distance, location and rotation, and the second which would reset the current viewport, to this default. The Default viewport would be saved in the preferences, and be the one that is used when openscad starts up.

Regards

Giles 
Reply | Threaded
Open this post in threaded view
|

Re: 3 different experimental patches for viewport

donbright
That is an interesting idea. The original problem I was trying to
solve was that some models are 'too small' and some are 'too big' for
the default viewport distance... (and I was restarting openscad alot
to play with various things that might crash it). What if instead of
viewport commands, the program just automatically zoomed to an
appropriate distance on startup (and you could turn this on/off in the
preferences window)? I think alot of CAD programs call this 'Zoom
All'? And mabye there could be a "Zoom All" item in the "View" menu?

DB

On Thu, Jul 14, 2011 at 4:03 AM, Giles Bathgate
<[hidden email]> wrote:

> On 13 Jul 2011 20:43, "Don Bright" <[hidden email]> wrote:
>
>> Because I don't want it to change the viewport while I am working,
>> after every compilation. I only want it to change the viewport on the
>> first time I load and compile a model during a session
>> (starting_viewport), or during animation (animation_viewport).
>> Otherwise I want it to leave the viewport alone and let me control it
>> manually with the mouse. Thanks.
>
> This gives me an idea which is complimentary to your patch. In the view menu
> currently there are options to set the viewport to one of Top, Bottom, Left
> Right, etc. If there were two more options in there "Set Default Viewport",
> and "Default Ctrl+O", the first of which could open a simple GUI for setting
> the distance, location and rotation, and the second which would reset the
> current viewport, to this default. The Default viewport would be saved in
> the preferences, and be the one that is used when openscad starts up.
> Regards
> Giles
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
>
>

Reply | Threaded
Open this post in threaded view
|

Re: 3 different experimental patches for viewport

Giles Bathgate-2
On 14 July 2011 17:15, Don Bright <[hidden email]> wrote:

> That is an interesting idea. The original problem I was trying to
> solve was that some models are 'too small' and some are 'too big' for
> the default viewport distance... (and I was restarting openscad alot
> to play with various things that might crash it). What if instead of
> viewport commands, the program just automatically zoomed to an
> appropriate distance on startup (and you could turn this on/off in the
> preferences window)? I think alot of CAD programs call this 'Zoom
> All'? And mabye there could be a "Zoom All" item in the "View" menu?
>
> DB

Yep I like that autozoom idea too, but I think all these features are
complimentary, and I would prefer if we could have both. I think that
the openscad community and its maintainers would be more comfortable
with the "Default viewport" and autozoom preferences, than changes to
the language syntax. For example I merged that named colours patch on
a bit of a whim, and you later decided to change the syntax. The
language syntax needs to be more stable (but I think we got away with
this one because there was no binary release done.) otherwise it could
cause backwards compatibility issues. So I think the language changes
need more careful consideration.