discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Pre-defined camera views include file

IO
Ian Oliver
Sat, Jul 1, 2017 9:42 AM

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];

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];
P
Parkinbot
Sun, Jul 2, 2017 8:31 PM

Nice but somehow clumsy work-around for an  old feature-request
https://github.com/openscad/openscad/issues/194  that never made it.

--
View this message in context: http://forum.openscad.org/Pre-defined-camera-views-include-file-tp21767p21768.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Nice but somehow clumsy work-around for an old feature-request <https://github.com/openscad/openscad/issues/194> that never made it. -- View this message in context: http://forum.openscad.org/Pre-defined-camera-views-include-file-tp21767p21768.html Sent from the OpenSCAD mailing list archive at Nabble.com.
IO
Ian Oliver
Sun, Jul 2, 2017 8:56 PM

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.

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.
MC
Mr C Camacho
Mon, Jul 3, 2017 9:51 AM

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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
IO
Ian Oliver
Mon, Jul 3, 2017 10:48 AM

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.

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.
MC
Mr C Camacho
Mon, Jul 3, 2017 11:50 AM

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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
IO
Ian Oliver
Mon, Jul 3, 2017 12:11 PM

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.

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.