Pre-defined camera views include file

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

Pre-defined camera views include file

Gadgetmind
I hope someone may find this useful.

I design some objects that need to match drawings and screen grabs, so
I've been using a Windows utility to let me make the OpenSCAD GUI
transparent so I can compare my 3D object with the reference material.

Here is the utility.

http://www.vanmiddlesworth.org/vitrite/

I make the material full screen in my picture viewer, give focus to
OpenSCAD, and then set varying degrees of transparency while using an
external editor to update the SCAD files (dual monitors essential!). To
match each picture I have a "View" defined and use this include file to
let me set the camera based on whatever View is defined/overridden to be.

// Include into any file and set View to force certain camera settings
as per table below.
// View of empty string leaves camera unchanged.

View = "";

Views = [ //    Name        Rotate            Translate Distance
     [    "", [        $vpr,            $vpt,        $vpd    ]],
     [    "TopTail1", [    [0,0,90],        [240, 0, 0],    540 ]],    // ?
     [    "TopTail2", [    [-20,0,86.7],        [204, -12, 0], 780    
]],    // Angle to match overhead grab
     [    "Side1", [    [90, 0, 0],        [173, -12, 113],745 ]],    //
Matches full screen b/w blueprint side view
     [    "Top1", [    [0, 0, 0],        [170, -41, 113],745 ]],    //
Matches full screen b/w blueprint top view
     [    "Landing1", [    [95.5, 1.5, 293],    [154, 10, 5], 488    
]],    // Landing on elevator cars
     [    "Side2", [    [90, 0, 0],        [166, -12, 20], 880    ]],    
// Side view in "clave" picture
     [    "Side3", [    [90, 0, 5],        [242, -12, 17], 530    ]]    
// Side view of tail on runway

];

Result = search ([View], Views);
Index = Result[0]; // Search returns a vector
assert (len(Index) == undef); // View not found if not simple number.

Item = Views[Index][1];

$vpr = Item[0];
$vpt = Item[1];
$vpd = Item[2];




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Pre-defined camera views include file

Parkinbot
Nice but somehow clumsy work-around for an old feature-request that never made it.
Reply | Threaded
Open this post in threaded view
|

Re: Pre-defined camera views include file

Gadgetmind
On 2017-07-02 21:31, Parkinbot wrote:
> Nice but somehow clumsy work-around for an  old feature-request
> <https://github.com/openscad/openscad/issues/194>   that never made it.

I work with the tools I have rather than the ones that I'd like. :-)

But yes, it is clumsy and accident prone, and I'd love background images
and variable transparency.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Pre-defined camera views include file

codifies
Why use a tool, I just tell the window manager to make the application a
bit more transparent...

On 02/07/17 21:56, Ian Oliver wrote:

> On 2017-07-02 21:31, Parkinbot wrote:
>> Nice but somehow clumsy work-around for an  old feature-request
>> <https://github.com/openscad/openscad/issues/194>   that never made it.
>
> I work with the tools I have rather than the ones that I'd like. :-)
>
> But yes, it is clumsy and accident prone, and I'd love background
> images and variable transparency.
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Pre-defined camera views include file

Gadgetmind
On 2017-07-03 10:51, Mr C Camacho wrote:
> Why use a tool, I just tell the window manager to make the application
> a bit more transparent...

I don't know how to do this on Windows 7. Plus I was really showing my
simple code to get a few fixed views in case it helped/inspired anyone else.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Pre-defined camera views include file

codifies
surely windows lets you change transparency on individual this has been
a minor feature of other OS's for near on a decade now!

On 03/07/17 11:48, Ian Oliver wrote:

> On 2017-07-03 10:51, Mr C Camacho wrote:
>> Why use a tool, I just tell the window manager to make the
>> application a bit more transparent...
>
> I don't know how to do this on Windows 7. Plus I was really showing my
> simple code to get a few fixed views in case it helped/inspired anyone
> else.
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Pre-defined camera views include file

Gadgetmind
On 2017-07-03 12:50, Mr C Camacho wrote:
> surely windows lets you change transparency on individual this has
> been a minor feature of other OS's for near on a decade now!

Well, Windows 7 is eight years old, and more modern versions may let you
do this.

As it happens, I am about to hit the Ubuntu forums for advice on
building a high end box for OpenSCAD etc. work. I have seven other
Ubuntu boxes around but mainly servers and my MythTV system.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org