discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

CPU load remains high after previewing but not after render

TA
Todd Allen
Mon, Aug 5, 2024 3:39 AM

Yes, display performance becomes bearable when preview faceting is kept
very low.  I figured I was running into a bug in OpenSCAD or my graphics
driver as the display is quite responsive at vastly higher numbers of faces
generated by a render.

On Sun, Aug 4, 2024 at 10:20 PM Todd Allen speedebikes@gmail.com wrote:

Yes, just checked it is doing software graphics.  It is possible to use
GPU graphics but it looks like I have a few hoops to jump through.  Why is
displaying a preview so much more demanding than displaying a render?
Anyway for now I'll see if I can get by just making previews very coarse
grained.

On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM john.lck40@gmail.com wrote:

Do you have GPU passthrough for your VM? When running under
virtualization, it may run under software rendering. And I doubt if
Fusion360 is much more graphically demanding, openscad preview render is
kind of like unoptimized ray-tracing (from my understanding) which is quite
heavy even for good GPUs, and it will definitely stress your CPU when run
under software rendering.
On 5/8/2024 10:43, Todd Allen wrote:

Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
OS is a fully updated Arch linux virtual machine running under Qubes OS
4.2 with pvh virtualization and seamless integration enabled.
I get the same behavior with both a week old unstable release and the
last stable release 2024.01.06 of OpenSCAD, both are .appimage files.

I think the issue may be a graphics driver as the problem got much worse
after switching from a 1080p monitor to a 2560x1440 monitor.

I have a Windows VM which I rarely use to run Fusion360 which is a much
more graphically demanding app and it runs well.  I should try OpenSCAD
there to help isolate if the problem is with the linux graphics driver.
Curiously though when I render the video is smooth and fairly responsive
under linux and it is only when looking at a preview the system chokes.

Here's a sample script which causes this:

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>

$fn= $preview ? 32 : 256;
eps = 0.002;

module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5,
inner_chamfer, outer_chamfer) {
$rod_d = rod_d;
$wall_t = wall_t;
$corner_size = corner_size;
$inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer;
$outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer;
$pipe_d = $rod_d+2*$wall_t;
$flange_t = $wall_t;
$flange_fillet = 1.25*$wall_t;
$corner_cut = $rod_d0.5+$wall_t0.8;
children();
}

module leg(h, d, cb, ct) {
joined_shape = rect([h-$flange_fillet0.6,$flange_t]);
union() {
zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
for(a = [-45,-135]) zrot(a) right($pipe_d
0.5) yrot(90)
down($pipe_d0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d,
length=h
0.6, fillet=$flange_fillet, n=24);
}
}

module leg_core(h, d, cb, ct) {
down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct,
circum=true);
}

module corner() {
ang = acos(1/sqrt(3));
h = $corner_size-$corner_cut;
top_half(s=200) up(h1.04) {
difference() {
zrot_copies(n=3) xrot(ang) down(h
0.5+$corner_cut) leg(h,
$pipe_d, $outer_chamfer, $inner_chamfer);
zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut)
leg_core(h, $rod_d, -$outer_chamfer,0);
// trim bottom outer edge of flange
// figuring out a formula too hard for now so if parameters
change this will need tweaking, probably make these values enviroment vars
zrot_copies(n=3) fwd(14) down(h) xrot(45)
cuboid([26,3,7],anchor=BACK);
}
}
}

// EXAMPLE invocation
setenv_RodFrame() corner();

On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss <
discuss@lists.openscad.org> wrote:

What is the openscad version, as well as OS and hardware spec? Nightly
version is using a different preview pipeline. And this somehow makes me
wonder if you are using software rendering instead of GPU rendering.
On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:

Can you share a picture of your model?

On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, <
discuss@lists.openscad.org> wrote:

I use the render key but the other two are no longer of much use.  If I
can I'll rewrite the <export STL> key to do a render with $export=true
which I can test in script to go higher res and then export an OBJ.

On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:

F5, F6 and F7 do preview, render and export but I think F7 is STL only.

On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

When working with complex high facet models I've turned off automatic
preview and just use rendering because previewing overheats my CPU and
makes it nearly impossible to adjust the viewport as much of the interface
becomes so sluggish it is practically frozen.  I had been taking advantage
of the $preview variable to set the other resolution adjusting vars such as
$fs to minimize resolution for previewing and have a high resolution for
rendering.  But now I have been manually changing vars to only have high
res for renders before exporting.  What I'd really love to have is a way to
do single keystrokes for a preview render, a full render and an export
render (as an obj and not an stl).  I expect I will have to build my own
from source to achieve this but thought I would ask in case I am missing
something and other solutions are possible.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Yes, display performance becomes bearable when preview faceting is kept very low. I figured I was running into a bug in OpenSCAD or my graphics driver as the display is quite responsive at vastly higher numbers of faces generated by a render. On Sun, Aug 4, 2024 at 10:20 PM Todd Allen <speedebikes@gmail.com> wrote: > Yes, just checked it is doing software graphics. It is possible to use > GPU graphics but it looks like I have a few hoops to jump through. Why is > displaying a preview so much more demanding than displaying a render? > Anyway for now I'll see if I can get by just making previews very coarse > grained. > > On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM <john.lck40@gmail.com> wrote: > >> Do you have GPU passthrough for your VM? When running under >> virtualization, it may run under software rendering. And I doubt if >> Fusion360 is much more graphically demanding, openscad preview render is >> kind of like unoptimized ray-tracing (from my understanding) which is quite >> heavy even for good GPUs, and it will definitely stress your CPU when run >> under software rendering. >> On 5/8/2024 10:43, Todd Allen wrote: >> >> Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram >> OS is a fully updated Arch linux virtual machine running under Qubes OS >> 4.2 with pvh virtualization and seamless integration enabled. >> I get the same behavior with both a week old unstable release and the >> last stable release 2024.01.06 of OpenSCAD, both are .appimage files. >> >> I think the issue may be a graphics driver as the problem got much worse >> after switching from a 1080p monitor to a 2560x1440 monitor. >> >> I have a Windows VM which I rarely use to run Fusion360 which is a much >> more graphically demanding app and it runs well. I should try OpenSCAD >> there to help isolate if the problem is with the linux graphics driver. >> Curiously though when I render the video is smooth and fairly responsive >> under linux and it is only when looking at a preview the system chokes. >> >> Here's a sample script which causes this: >> >> include <BOSL2/std.scad> >> include <BOSL2/rounding.scad> >> >> $fn= $preview ? 32 : 256; >> eps = 0.002; >> >> module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5, >> inner_chamfer, outer_chamfer) { >> $rod_d = rod_d; >> $wall_t = wall_t; >> $corner_size = corner_size; >> $inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer; >> $outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer; >> $pipe_d = $rod_d+2*$wall_t; >> $flange_t = $wall_t; >> $flange_fillet = 1.25*$wall_t; >> $corner_cut = $rod_d*0.5+$wall_t*0.8; >> children(); >> } >> >> module leg(h, d, cb, ct) { >> joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); >> union() { >> zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); >> for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) yrot(90) >> down($pipe_d*0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d, >> length=h*0.6, fillet=$flange_fillet, n=24); >> } >> } >> >> module leg_core(h, d, cb, ct) { >> down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, >> circum=true); >> } >> >> module corner() { >> ang = acos(1/sqrt(3)); >> h = $corner_size-$corner_cut; >> top_half(s=200) up(h*1.04) { >> difference() { >> zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg(h, >> $pipe_d, $outer_chamfer, $inner_chamfer); >> zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) >> leg_core(h, $rod_d, -$outer_chamfer,0); >> // trim bottom outer edge of flange >> // figuring out a formula too hard for now so if parameters >> change this will need tweaking, probably make these values enviroment vars >> zrot_copies(n=3) fwd(14) down(h) xrot(45) >> cuboid([26,3,7],anchor=BACK); >> } >> } >> } >> >> // EXAMPLE invocation >> setenv_RodFrame() corner(); >> >> >> On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss < >> discuss@lists.openscad.org> wrote: >> >>> What is the openscad version, as well as OS and hardware spec? Nightly >>> version is using a different preview pipeline. And this somehow makes me >>> wonder if you are using software rendering instead of GPU rendering. >>> On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: >>> >>> Can you share a picture of your model? >>> >>> >>> On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, < >>> discuss@lists.openscad.org> wrote: >>> >>>> I use the render key but the other two are no longer of much use. If I >>>> can I'll rewrite the <export STL> key to do a render with $export=true >>>> which I can test in script to go higher res and then export an OBJ. >>>> >>>> On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss < >>>> discuss@lists.openscad.org> wrote: >>>> >>>>> F5, F6 and F7 do preview, render and export but I think F7 is STL only. >>>>> >>>>> On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss < >>>>> discuss@lists.openscad.org> wrote: >>>>> >>>>>> When working with complex high facet models I've turned off automatic >>>>>> preview and just use rendering because previewing overheats my CPU and >>>>>> makes it nearly impossible to adjust the viewport as much of the interface >>>>>> becomes so sluggish it is practically frozen. I had been taking advantage >>>>>> of the $preview variable to set the other resolution adjusting vars such as >>>>>> $fs to minimize resolution for previewing and have a high resolution for >>>>>> rendering. But now I have been manually changing vars to only have high >>>>>> res for renders before exporting. What I'd really love to have is a way to >>>>>> do single keystrokes for a preview render, a full render and an export >>>>>> render (as an obj and not an stl). I expect I will have to build my own >>>>>> from source to achieve this but thought I would ask in case I am missing >>>>>> something and other solutions are possible. >>>>>> _______________________________________________ >>>>>> OpenSCAD mailing list >>>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >>
CK
Chun Kit LAM
Mon, Aug 5, 2024 4:48 AM

If you look at the paper of OpenCSG, which is the backend for preview,
you will see that the Goldfeather algorithm has a complexity of O(n^2).
Even with depth complexity optimization, it is still O(kn). And you need
to do that for each pixel (AFAIK). This is why it is slow.

I think you will have better luck running the actual render and do not
use preview. This may be slower at first, but it does not require
running an expensive shader every frame.

On 5/8/2024 11:39, Todd Allen wrote:

Yes, display performance becomes bearable when preview faceting is
kept very low.  I figured I was running into a bug in OpenSCAD or my
graphics driver as the display is quite responsive at vastly higher
numbers of faces generated by a render.

On Sun, Aug 4, 2024 at 10:20 PM Todd Allen speedebikes@gmail.com wrote:

 Yes, just checked it is doing software graphics.  It is possible
 to use GPU graphics but it looks like I have a few hoops to jump
 through.  Why is displaying a preview so much more demanding than
 displaying a render? Anyway for now I'll see if I can get by just
 making previews very coarse grained.

 On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM
 <john.lck40@gmail.com> wrote:

     Do you have GPU passthrough for your VM? When running under
     virtualization, it may run under software rendering. And I
     doubt if Fusion360 is much more graphically demanding,
     openscad preview render is kind of like unoptimized
     ray-tracing (from my understanding) which is quite heavy even
     for good GPUs, and it will definitely stress your CPU when run
     under software rendering.

     On 5/8/2024 10:43, Todd Allen wrote:
     Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
     OS is a fully updated Arch linux virtual machine running
     under Qubes OS 4.2 with pvh virtualization and seamless
     integration enabled.
     I get the same behavior with both a week old unstable release
     and the last stable release 2024.01.06 of OpenSCAD, both are
     .appimage files.

     I think the issue may be a graphics driver as the problem got
     much worse after switching from a 1080p monitor to a
     2560x1440 monitor.

     I have a Windows VM which I rarely use to run Fusion360 which
     is a much more graphically demanding app and it runs well.  I
     should try OpenSCAD there to help isolate if the problem is
     with the linux graphics driver.  Curiously though when I
     render the video is smooth and fairly responsive under linux
     and it is only when looking at a preview the system chokes.

     Here's a sample script which causes this:

     include <BOSL2/std.scad>
     include <BOSL2/rounding.scad>

     $fn= $preview ? 32 : 256;
     eps = 0.002;

     module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26,
     chamfer=0.5, inner_chamfer, outer_chamfer) {
         $rod_d = rod_d;
         $wall_t = wall_t;
         $corner_size = corner_size;
         $inner_chamfer = is_undef(inner_chamfer) ? chamfer :
     inner_chamfer;
         $outer_chamfer = is_undef(outer_chamfer) ? chamfer :
     outer_chamfer;
         $pipe_d = $rod_d+2*$wall_t;
         $flange_t = $wall_t;
         $flange_fillet = 1.25*$wall_t;
         $corner_cut = $rod_d*0.5+$wall_t*0.8;
         children();
     }

     module leg(h, d, cb, ct) {
         joined_shape = rect([h-$flange_fillet*0.6,$flange_t]);
         union() {
             zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
             for(a = [-45,-135]) zrot(a) right($pipe_d*0.5)
     yrot(90) down($pipe_d*0.5)
     join_prism(joined_shape,base="cylinder",base_d=$pipe_d,
     length=h*0.6, fillet=$flange_fillet, n=24);
             }
     }

     module leg_core(h, d, cb, ct) {
         down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct,
     circum=true);
     }

     module corner() {
         ang = acos(1/sqrt(3));
         h = $corner_size-$corner_cut;
         top_half(s=200) up(h*1.04) {
             difference() {
                 zrot_copies(n=3) xrot(ang)
     down(h*0.5+$corner_cut) leg(h, $pipe_d, $outer_chamfer,
     $inner_chamfer);
                 zrot_copies(n=3) xrot(ang)
     down(h*0.5+$corner_cut) leg_core(h, $rod_d, -$outer_chamfer,0);
                 // trim bottom outer edge of flange
                 // figuring out a formula too hard for now so if
     parameters change this will need tweaking, probably make
     these values enviroment vars
                 zrot_copies(n=3) fwd(14) down(h) xrot(45)
     cuboid([26,3,7],anchor=BACK);
                 }
             }
     }

     // EXAMPLE invocation
     setenv_RodFrame() corner();


     On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss
     <discuss@lists.openscad.org> wrote:

         What is the openscad version, as well as OS and hardware
         spec? Nightly version is using a different preview
         pipeline. And this somehow makes me wonder if you are
         using software rendering instead of GPU rendering.

         On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:
         Can you share a picture of your model?


         On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss,
         <discuss@lists.openscad.org> wrote:

             I use the render key but the other two are no longer
             of much use.  If I can I'll rewrite the <export STL>
             key to do a render with $export=true which I can
             test in script to go higher res and then export an OBJ.

             On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss
             <discuss@lists.openscad.org> wrote:

                 F5, F6 and F7 do preview, render and export but
                 I think F7 is STL only.

                 On Sun, 4 Aug 2024 at 17:44, Todd Allen via
                 Discuss <discuss@lists.openscad.org> wrote:

                     When working with complex high facet models
                     I've turned off automatic preview and just
                     use rendering because previewing overheats
                     my CPU and makes it nearly impossible to
                     adjust the viewport as much of the interface
                     becomes so sluggish it is practically
                     frozen.  I had been taking advantage of the
                     $preview variable to set the other
                     resolution adjusting vars such as $fs to
                     minimize resolution for previewing and have
                     a high resolution for rendering.  But now I
                     have been manually changing vars to only
                     have high res for renders before exporting. 
                     What I'd really love to have is a way to do
                     single keystrokes for a preview render, a
                     full render and an export render (as an obj
                     and not an stl).  I expect I will have to
                     build my own from source to achieve this but
                     thought I would ask in case I am missing
                     something and other solutions are possible.
                     _______________________________________________
                     OpenSCAD mailing list
                     To unsubscribe send an email to
                     discuss-leave@lists.openscad.org

                 _______________________________________________
                 OpenSCAD mailing list
                 To unsubscribe send an email to
                 discuss-leave@lists.openscad.org

             _______________________________________________
             OpenSCAD mailing list
             To unsubscribe send an email to
             discuss-leave@lists.openscad.org


         _______________________________________________
         OpenSCAD mailing list
         To unsubscribe send an email todiscuss-leave@lists.openscad.org
         _______________________________________________
         OpenSCAD mailing list
         To unsubscribe send an email to
         discuss-leave@lists.openscad.org
If you look at the paper of OpenCSG, which is the backend for preview, you will see that the Goldfeather algorithm has a complexity of O(n^2). Even with depth complexity optimization, it is still O(kn). And you need to do that for each pixel (AFAIK). This is why it is slow. I think you will have better luck running the actual render and do not use preview. This may be slower at first, but it does not require running an expensive shader every frame. On 5/8/2024 11:39, Todd Allen wrote: > Yes, display performance becomes bearable when preview faceting is > kept very low.  I figured I was running into a bug in OpenSCAD or my > graphics driver as the display is quite responsive at vastly higher > numbers of faces generated by a render. > > On Sun, Aug 4, 2024 at 10:20 PM Todd Allen <speedebikes@gmail.com> wrote: > > Yes, just checked it is doing software graphics.  It is possible > to use GPU graphics but it looks like I have a few hoops to jump > through.  Why is displaying a preview so much more demanding than > displaying a render? Anyway for now I'll see if I can get by just > making previews very coarse grained. > > On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM > <john.lck40@gmail.com> wrote: > > Do you have GPU passthrough for your VM? When running under > virtualization, it may run under software rendering. And I > doubt if Fusion360 is much more graphically demanding, > openscad preview render is kind of like unoptimized > ray-tracing (from my understanding) which is quite heavy even > for good GPUs, and it will definitely stress your CPU when run > under software rendering. > > On 5/8/2024 10:43, Todd Allen wrote: >> Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram >> OS is a fully updated Arch linux virtual machine running >> under Qubes OS 4.2 with pvh virtualization and seamless >> integration enabled. >> I get the same behavior with both a week old unstable release >> and the last stable release 2024.01.06 of OpenSCAD, both are >> .appimage files. >> >> I think the issue may be a graphics driver as the problem got >> much worse after switching from a 1080p monitor to a >> 2560x1440 monitor. >> >> I have a Windows VM which I rarely use to run Fusion360 which >> is a much more graphically demanding app and it runs well.  I >> should try OpenSCAD there to help isolate if the problem is >> with the linux graphics driver.  Curiously though when I >> render the video is smooth and fairly responsive under linux >> and it is only when looking at a preview the system chokes. >> >> Here's a sample script which causes this: >> >> include <BOSL2/std.scad> >> include <BOSL2/rounding.scad> >> >> $fn= $preview ? 32 : 256; >> eps = 0.002; >> >> module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, >> chamfer=0.5, inner_chamfer, outer_chamfer) { >>     $rod_d = rod_d; >>     $wall_t = wall_t; >>     $corner_size = corner_size; >>     $inner_chamfer = is_undef(inner_chamfer) ? chamfer : >> inner_chamfer; >>     $outer_chamfer = is_undef(outer_chamfer) ? chamfer : >> outer_chamfer; >>     $pipe_d = $rod_d+2*$wall_t; >>     $flange_t = $wall_t; >>     $flange_fillet = 1.25*$wall_t; >>     $corner_cut = $rod_d*0.5+$wall_t*0.8; >>     children(); >> } >> >> module leg(h, d, cb, ct) { >>     joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); >>     union() { >>         zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); >>         for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) >> yrot(90) down($pipe_d*0.5) >> join_prism(joined_shape,base="cylinder",base_d=$pipe_d, >> length=h*0.6, fillet=$flange_fillet, n=24); >>         } >> } >> >> module leg_core(h, d, cb, ct) { >>     down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, >> circum=true); >> } >> >> module corner() { >>     ang = acos(1/sqrt(3)); >>     h = $corner_size-$corner_cut; >>     top_half(s=200) up(h*1.04) { >>         difference() { >>             zrot_copies(n=3) xrot(ang) >> down(h*0.5+$corner_cut) leg(h, $pipe_d, $outer_chamfer, >> $inner_chamfer); >>             zrot_copies(n=3) xrot(ang) >> down(h*0.5+$corner_cut) leg_core(h, $rod_d, -$outer_chamfer,0); >>             // trim bottom outer edge of flange >>             // figuring out a formula too hard for now so if >> parameters change this will need tweaking, probably make >> these values enviroment vars >>             zrot_copies(n=3) fwd(14) down(h) xrot(45) >> cuboid([26,3,7],anchor=BACK); >>             } >>         } >> } >> >> // EXAMPLE invocation >> setenv_RodFrame() corner(); >> >> >> On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss >> <discuss@lists.openscad.org> wrote: >> >> What is the openscad version, as well as OS and hardware >> spec? Nightly version is using a different preview >> pipeline. And this somehow makes me wonder if you are >> using software rendering instead of GPU rendering. >> >> On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: >>> Can you share a picture of your model? >>> >>> >>> On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, >>> <discuss@lists.openscad.org> wrote: >>> >>> I use the render key but the other two are no longer >>> of much use.  If I can I'll rewrite the <export STL> >>> key to do a render with $export=true which I can >>> test in script to go higher res and then export an OBJ. >>> >>> On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss >>> <discuss@lists.openscad.org> wrote: >>> >>> F5, F6 and F7 do preview, render and export but >>> I think F7 is STL only. >>> >>> On Sun, 4 Aug 2024 at 17:44, Todd Allen via >>> Discuss <discuss@lists.openscad.org> wrote: >>> >>> When working with complex high facet models >>> I've turned off automatic preview and just >>> use rendering because previewing overheats >>> my CPU and makes it nearly impossible to >>> adjust the viewport as much of the interface >>> becomes so sluggish it is practically >>> frozen.  I had been taking advantage of the >>> $preview variable to set the other >>> resolution adjusting vars such as $fs to >>> minimize resolution for previewing and have >>> a high resolution for rendering.  But now I >>> have been manually changing vars to only >>> have high res for renders before exporting.  >>> What I'd really love to have is a way to do >>> single keystrokes for a preview render, a >>> full render and an export render (as an obj >>> and not an stl).  I expect I will have to >>> build my own from source to achieve this but >>> thought I would ask in case I am missing >>> something and other solutions are possible. >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to >>> discuss-leave@lists.openscad.org >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to >>> discuss-leave@lists.openscad.org >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to >>> discuss-leave@lists.openscad.org >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email todiscuss-leave@lists.openscad.org >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to >> discuss-leave@lists.openscad.org >>
MM
Michael Marx (spintel)
Mon, Aug 5, 2024 6:18 AM

Also make sure you have large cache sizes in preferences, re-render will be quicker.


From: Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org]
Sent: Mon, 5 Aug 2024 14:48
To: Todd Allen
Cc: OpenSCAD general discussion Mailing-list; Chun Kit LAM
Subject: [OpenSCAD] Re: CPU load remains high after previewing but not after render

If you look at the paper of OpenCSG, which is the backend for preview, you will see that the Goldfeather algorithm has a complexity of O(n^2). Even with depth complexity optimization, it is still O(kn). And you need to do that for each pixel (AFAIK). This is why it is slow.

I think you will have better luck running the actual render and do not use preview. This may be slower at first, but it does not require running an expensive shader every frame.

On 5/8/2024 11:39, Todd Allen wrote:

Yes, display performance becomes bearable when preview faceting is kept very low.  I figured I was running into a bug in OpenSCAD or my graphics driver as the display is quite responsive at vastly higher numbers of faces generated by a render.

On Sun, Aug 4, 2024 at 10:20 PM Todd Allen speedebikes@gmail.com wrote:

Yes, just checked it is doing software graphics.  It is possible to use GPU graphics but it looks like I have a few hoops to jump through.  Why is displaying a preview so much more demanding than displaying a render?  Anyway for now I'll see if I can get by just making previews very coarse grained.

On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM john.lck40@gmail.com wrote:

Do you have GPU passthrough for your VM? When running under virtualization, it may run under software rendering. And I doubt if Fusion360 is much more graphically demanding, openscad preview render is kind of like unoptimized ray-tracing (from my understanding) which is quite heavy even for good GPUs, and it will definitely stress your CPU when run under software rendering.

On 5/8/2024 10:43, Todd Allen wrote:

Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
OS is a fully updated Arch linux virtual machine running under Qubes OS 4.2 with pvh virtualization and seamless integration enabled.
I get the same behavior with both a week old unstable release and the last stable release 2024.01.06 of OpenSCAD, both are .appimage files.

I think the issue may be a graphics driver as the problem got much worse after switching from a 1080p monitor to a 2560x1440 monitor.

I have a Windows VM which I rarely use to run Fusion360 which is a much more graphically demanding app and it runs well.  I should try OpenSCAD there to help isolate if the problem is with the linux graphics driver.  Curiously though when I render the video is smooth and fairly responsive under linux and it is only when looking at a preview the system chokes.

Here's a sample script which causes this:

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>

$fn= $preview ? 32 : 256;
eps = 0.002;

module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5, inner_chamfer, outer_chamfer) {
$rod_d = rod_d;
$wall_t = wall_t;
$corner_size = corner_size;
$inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer;
$outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer;
$pipe_d = $rod_d+2*$wall_t;
$flange_t = $wall_t;
$flange_fillet = 1.25*$wall_t;
$corner_cut = $rod_d0.5+$wall_t0.8;
children();
}

module leg(h, d, cb, ct) {
joined_shape = rect([h-$flange_fillet0.6,$flange_t]);
union() {
zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
for(a = [-45,-135]) zrot(a) right($pipe_d
0.5) yrot(90) down($pipe_d0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d, length=h0.6, fillet=$flange_fillet, n=24);
}
}

module leg_core(h, d, cb, ct) {
down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, circum=true);
}

module corner() {
ang = acos(1/sqrt(3));
h = $corner_size-$corner_cut;
top_half(s=200) up(h1.04) {
difference() {
zrot_copies(n=3) xrot(ang) down(h
0.5+$corner_cut) leg(h, $pipe_d, $outer_chamfer, $inner_chamfer);
zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg_core(h, $rod_d, -$outer_chamfer,0);
// trim bottom outer edge of flange
// figuring out a formula too hard for now so if parameters change this will need tweaking, probably make these values enviroment vars
zrot_copies(n=3) fwd(14) down(h) xrot(45) cuboid([26,3,7],anchor=BACK);
}
}
}

// EXAMPLE invocation
setenv_RodFrame() corner();

On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss discuss@lists.openscad.org wrote:

What is the openscad version, as well as OS and hardware spec? Nightly version is using a different preview pipeline. And this somehow makes me wonder if you are using software rendering instead of GPU rendering.

On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:

Can you share a picture of your model?

On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, discuss@lists.openscad.org wrote:

I use the render key but the other two are no longer of much use.  If I can I'll rewrite the <export STL> key to do a render with $export=true which I can test in script to go higher res and then export an OBJ.

On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss discuss@lists.openscad.org wrote:

F5, F6 and F7 do preview, render and export but I think F7 is STL only.

On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss discuss@lists.openscad.org wrote:

When working with complex high facet models I've turned off automatic preview and just use rendering because previewing overheats my CPU and makes it nearly impossible to adjust the viewport as much of the interface becomes so sluggish it is practically frozen.  I had been taking advantage of the $preview variable to set the other resolution adjusting vars such as $fs to minimize resolution for previewing and have a high resolution for rendering.  But now I have been manually changing vars to only have high res for renders before exporting.  What I'd really love to have is a way to do single keystrokes for a preview render, a full render and an export render (as an obj and not an stl).  I expect I will have to build my own from source to achieve this but thought I would ask in case I am missing something and other solutions are possible.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Also make sure you have large cache sizes in preferences, re-render will be quicker. _____ From: Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org] Sent: Mon, 5 Aug 2024 14:48 To: Todd Allen Cc: OpenSCAD general discussion Mailing-list; Chun Kit LAM Subject: [OpenSCAD] Re: CPU load remains high after previewing but not after render If you look at the paper of OpenCSG, which is the backend for preview, you will see that the Goldfeather algorithm has a complexity of O(n^2). Even with depth complexity optimization, it is still O(kn). And you need to do that for each pixel (AFAIK). This is why it is slow. I think you will have better luck running the actual render and do not use preview. This may be slower at first, but it does not require running an expensive shader every frame. On 5/8/2024 11:39, Todd Allen wrote: Yes, display performance becomes bearable when preview faceting is kept very low. I figured I was running into a bug in OpenSCAD or my graphics driver as the display is quite responsive at vastly higher numbers of faces generated by a render. On Sun, Aug 4, 2024 at 10:20 PM Todd Allen <speedebikes@gmail.com> wrote: Yes, just checked it is doing software graphics. It is possible to use GPU graphics but it looks like I have a few hoops to jump through. Why is displaying a preview so much more demanding than displaying a render? Anyway for now I'll see if I can get by just making previews very coarse grained. On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM <john.lck40@gmail.com> wrote: Do you have GPU passthrough for your VM? When running under virtualization, it may run under software rendering. And I doubt if Fusion360 is much more graphically demanding, openscad preview render is kind of like unoptimized ray-tracing (from my understanding) which is quite heavy even for good GPUs, and it will definitely stress your CPU when run under software rendering. On 5/8/2024 10:43, Todd Allen wrote: Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram OS is a fully updated Arch linux virtual machine running under Qubes OS 4.2 with pvh virtualization and seamless integration enabled. I get the same behavior with both a week old unstable release and the last stable release 2024.01.06 of OpenSCAD, both are .appimage files. I think the issue may be a graphics driver as the problem got much worse after switching from a 1080p monitor to a 2560x1440 monitor. I have a Windows VM which I rarely use to run Fusion360 which is a much more graphically demanding app and it runs well. I should try OpenSCAD there to help isolate if the problem is with the linux graphics driver. Curiously though when I render the video is smooth and fairly responsive under linux and it is only when looking at a preview the system chokes. Here's a sample script which causes this: include <BOSL2/std.scad> include <BOSL2/rounding.scad> $fn= $preview ? 32 : 256; eps = 0.002; module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5, inner_chamfer, outer_chamfer) { $rod_d = rod_d; $wall_t = wall_t; $corner_size = corner_size; $inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer; $outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer; $pipe_d = $rod_d+2*$wall_t; $flange_t = $wall_t; $flange_fillet = 1.25*$wall_t; $corner_cut = $rod_d*0.5+$wall_t*0.8; children(); } module leg(h, d, cb, ct) { joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); union() { zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) yrot(90) down($pipe_d*0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d, length=h*0.6, fillet=$flange_fillet, n=24); } } module leg_core(h, d, cb, ct) { down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, circum=true); } module corner() { ang = acos(1/sqrt(3)); h = $corner_size-$corner_cut; top_half(s=200) up(h*1.04) { difference() { zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg(h, $pipe_d, $outer_chamfer, $inner_chamfer); zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg_core(h, $rod_d, -$outer_chamfer,0); // trim bottom outer edge of flange // figuring out a formula too hard for now so if parameters change this will need tweaking, probably make these values enviroment vars zrot_copies(n=3) fwd(14) down(h) xrot(45) cuboid([26,3,7],anchor=BACK); } } } // EXAMPLE invocation setenv_RodFrame() corner(); On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss <discuss@lists.openscad.org> wrote: What is the openscad version, as well as OS and hardware spec? Nightly version is using a different preview pipeline. And this somehow makes me wonder if you are using software rendering instead of GPU rendering. On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: Can you share a picture of your model? On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, <discuss@lists.openscad.org> wrote: I use the render key but the other two are no longer of much use. If I can I'll rewrite the <export STL> key to do a render with $export=true which I can test in script to go higher res and then export an OBJ. On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss <discuss@lists.openscad.org> wrote: F5, F6 and F7 do preview, render and export but I think F7 is STL only. On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss <discuss@lists.openscad.org> wrote: When working with complex high facet models I've turned off automatic preview and just use rendering because previewing overheats my CPU and makes it nearly impossible to adjust the viewport as much of the interface becomes so sluggish it is practically frozen. I had been taking advantage of the $preview variable to set the other resolution adjusting vars such as $fs to minimize resolution for previewing and have a high resolution for rendering. But now I have been manually changing vars to only have high res for renders before exporting. What I'd really love to have is a way to do single keystrokes for a preview render, a full render and an export render (as an obj and not an stl). I expect I will have to build my own from source to achieve this but thought I would ask in case I am missing something and other solutions are possible. _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
NH
nop head
Mon, Aug 5, 2024 7:14 AM

I put a render() call around bits that cause the preview frame rate to
drop. It is much less of a problem with the new rendering system.

On Mon, 5 Aug 2024 at 07:19, Michael Marx (spintel) via Discuss <
discuss@lists.openscad.org> wrote:

Also make sure you have large cache sizes in preferences, re-render will
be quicker.


From: Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org]
Sent: Mon, 5 Aug 2024 14:48
To: Todd Allen
Cc: OpenSCAD general discussion Mailing-list; Chun Kit LAM
Subject: [OpenSCAD] Re: CPU load remains high after previewing but not
after render

If you look at the paper of OpenCSG, which is the backend for preview, you
will see that the Goldfeather algorithm has a complexity of O(n^2). Even
with depth complexity optimization, it is still O(kn). And you need to do
that for each pixel (AFAIK). This is why it is slow.

I think you will have better luck running the actual render and do not use
preview. This may be slower at first, but it does not require running an
expensive shader every frame.

On 5/8/2024 11:39, Todd Allen wrote:

Yes, display performance becomes bearable when preview faceting is kept
very low.  I figured I was running into a bug in OpenSCAD or my graphics
driver as the display is quite responsive at vastly higher numbers of faces
generated by a render.

On Sun, Aug 4, 2024 at 10:20 PM Todd Allen speedebikes@gmail.com wrote:

Yes, just checked it is doing software graphics.  It is possible to use
GPU graphics but it looks like I have a few hoops to jump through.  Why is
displaying a preview so much more demanding than displaying a render?
Anyway for now I'll see if I can get by just making previews very coarse
grained.

On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM john.lck40@gmail.com wrote:

Do you have GPU passthrough for your VM? When running under
virtualization, it may run under software rendering. And I doubt if
Fusion360 is much more graphically demanding, openscad preview render is
kind of like unoptimized ray-tracing (from my understanding) which is quite
heavy even for good GPUs, and it will definitely stress your CPU when run
under software rendering.

On 5/8/2024 10:43, Todd Allen wrote:

Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
OS is a fully updated Arch linux virtual machine running under Qubes OS
4.2 with pvh virtualization and seamless integration enabled.
I get the same behavior with both a week old unstable release and the last
stable release 2024.01.06 of OpenSCAD, both are .appimage files.

I think the issue may be a graphics driver as the problem got much worse
after switching from a 1080p monitor to a 2560x1440 monitor.

I have a Windows VM which I rarely use to run Fusion360 which is a much
more graphically demanding app and it runs well.  I should try OpenSCAD
there to help isolate if the problem is with the linux graphics driver.
Curiously though when I render the video is smooth and fairly responsive
under linux and it is only when looking at a preview the system chokes.

Here's a sample script which causes this:

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>

$fn= $preview ? 32 : 256;
eps = 0.002;

module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5,
inner_chamfer, outer_chamfer) {
$rod_d = rod_d;
$wall_t = wall_t;
$corner_size = corner_size;
$inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer;
$outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer;
$pipe_d = $rod_d+2*$wall_t;
$flange_t = $wall_t;
$flange_fillet = 1.25*$wall_t;
$corner_cut = $rod_d0.5+$wall_t0.8;
children();
}

module leg(h, d, cb, ct) {
joined_shape = rect([h-$flange_fillet0.6,$flange_t]);
union() {
zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
for(a = [-45,-135]) zrot(a) right($pipe_d
0.5) yrot(90)
down($pipe_d0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d,
length=h
0.6, fillet=$flange_fillet, n=24);
}
}

module leg_core(h, d, cb, ct) {
down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, circum=true);
}

module corner() {
ang = acos(1/sqrt(3));
h = $corner_size-$corner_cut;
top_half(s=200) up(h1.04) {
difference() {
zrot_copies(n=3) xrot(ang) down(h
0.5+$corner_cut) leg(h,
$pipe_d, $outer_chamfer, $inner_chamfer);
zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg_core(h,
$rod_d, -$outer_chamfer,0);
// trim bottom outer edge of flange
// figuring out a formula too hard for now so if parameters
change this will need tweaking, probably make these values enviroment vars
zrot_copies(n=3) fwd(14) down(h) xrot(45)
cuboid([26,3,7],anchor=BACK);
}
}
}

// EXAMPLE invocation
setenv_RodFrame() corner();

On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss <
discuss@lists.openscad.org> wrote:

What is the openscad version, as well as OS and hardware spec? Nightly
version is using a different preview pipeline. And this somehow makes me
wonder if you are using software rendering instead of GPU rendering.

On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:

Can you share a picture of your model?

On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, <
discuss@lists.openscad.org> wrote:

I use the render key but the other two are no longer of much use.  If I
can I'll rewrite the <export STL> key to do a render with $export=true
which I can test in script to go higher res and then export an OBJ.

On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:

F5, F6 and F7 do preview, render and export but I think F7 is STL only.

On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

When working with complex high facet models I've turned off automatic
preview and just use rendering because previewing overheats my CPU and
makes it nearly impossible to adjust the viewport as much of the interface
becomes so sluggish it is practically frozen.  I had been taking advantage
of the $preview variable to set the other resolution adjusting vars such as
$fs to minimize resolution for previewing and have a high resolution for
rendering.  But now I have been manually changing vars to only have high
res for renders before exporting.  What I'd really love to have is a way to
do single keystrokes for a preview render, a full render and an export
render (as an obj and not an stl).  I expect I will have to build my own
from source to achieve this but thought I would ask in case I am missing
something and other solutions are possible.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list

To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I put a render() call around bits that cause the preview frame rate to drop. It is much less of a problem with the new rendering system. On Mon, 5 Aug 2024 at 07:19, Michael Marx (spintel) via Discuss < discuss@lists.openscad.org> wrote: > Also make sure you have large cache sizes in preferences, re-render will > be quicker. > > > ------------------------------ > > *From:* Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org] > *Sent:* Mon, 5 Aug 2024 14:48 > *To:* Todd Allen > *Cc:* OpenSCAD general discussion Mailing-list; Chun Kit LAM > *Subject:* [OpenSCAD] Re: CPU load remains high after previewing but not > after render > > > > If you look at the paper of OpenCSG, which is the backend for preview, you > will see that the Goldfeather algorithm has a complexity of O(n^2). Even > with depth complexity optimization, it is still O(kn). And you need to do > that for each pixel (AFAIK). This is why it is slow. > > I think you will have better luck running the actual render and do not use > preview. This may be slower at first, but it does not require running an > expensive shader every frame. > > On 5/8/2024 11:39, Todd Allen wrote: > > Yes, display performance becomes bearable when preview faceting is kept > very low. I figured I was running into a bug in OpenSCAD or my graphics > driver as the display is quite responsive at vastly higher numbers of faces > generated by a render. > > > > On Sun, Aug 4, 2024 at 10:20 PM Todd Allen <speedebikes@gmail.com> wrote: > > Yes, just checked it is doing software graphics. It is possible to use > GPU graphics but it looks like I have a few hoops to jump through. Why is > displaying a preview so much more demanding than displaying a render? > Anyway for now I'll see if I can get by just making previews very coarse > grained. > > > > On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM <john.lck40@gmail.com> wrote: > > Do you have GPU passthrough for your VM? When running under > virtualization, it may run under software rendering. And I doubt if > Fusion360 is much more graphically demanding, openscad preview render is > kind of like unoptimized ray-tracing (from my understanding) which is quite > heavy even for good GPUs, and it will definitely stress your CPU when run > under software rendering. > > On 5/8/2024 10:43, Todd Allen wrote: > > Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram > OS is a fully updated Arch linux virtual machine running under Qubes OS > 4.2 with pvh virtualization and seamless integration enabled. > I get the same behavior with both a week old unstable release and the last > stable release 2024.01.06 of OpenSCAD, both are .appimage files. > > I think the issue may be a graphics driver as the problem got much worse > after switching from a 1080p monitor to a 2560x1440 monitor. > > I have a Windows VM which I rarely use to run Fusion360 which is a much > more graphically demanding app and it runs well. I should try OpenSCAD > there to help isolate if the problem is with the linux graphics driver. > Curiously though when I render the video is smooth and fairly responsive > under linux and it is only when looking at a preview the system chokes. > > Here's a sample script which causes this: > > include <BOSL2/std.scad> > include <BOSL2/rounding.scad> > > $fn= $preview ? 32 : 256; > eps = 0.002; > > module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5, > inner_chamfer, outer_chamfer) { > $rod_d = rod_d; > $wall_t = wall_t; > $corner_size = corner_size; > $inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer; > $outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer; > $pipe_d = $rod_d+2*$wall_t; > $flange_t = $wall_t; > $flange_fillet = 1.25*$wall_t; > $corner_cut = $rod_d*0.5+$wall_t*0.8; > children(); > } > > module leg(h, d, cb, ct) { > joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); > union() { > zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); > for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) yrot(90) > down($pipe_d*0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d, > length=h*0.6, fillet=$flange_fillet, n=24); > } > } > > module leg_core(h, d, cb, ct) { > down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, circum=true); > } > > module corner() { > ang = acos(1/sqrt(3)); > h = $corner_size-$corner_cut; > top_half(s=200) up(h*1.04) { > difference() { > zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg(h, > $pipe_d, $outer_chamfer, $inner_chamfer); > zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg_core(h, > $rod_d, -$outer_chamfer,0); > // trim bottom outer edge of flange > // figuring out a formula too hard for now so if parameters > change this will need tweaking, probably make these values enviroment vars > zrot_copies(n=3) fwd(14) down(h) xrot(45) > cuboid([26,3,7],anchor=BACK); > } > } > } > > // EXAMPLE invocation > setenv_RodFrame() corner(); > > > > On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss < > discuss@lists.openscad.org> wrote: > > What is the openscad version, as well as OS and hardware spec? Nightly > version is using a different preview pipeline. And this somehow makes me > wonder if you are using software rendering instead of GPU rendering. > > On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: > > Can you share a picture of your model? > > > > > > On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, < > discuss@lists.openscad.org> wrote: > > I use the render key but the other two are no longer of much use. If I > can I'll rewrite the <export STL> key to do a render with $export=true > which I can test in script to go higher res and then export an OBJ. > > > > On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss < > discuss@lists.openscad.org> wrote: > > F5, F6 and F7 do preview, render and export but I think F7 is STL only. > > > > On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss < > discuss@lists.openscad.org> wrote: > > When working with complex high facet models I've turned off automatic > preview and just use rendering because previewing overheats my CPU and > makes it nearly impossible to adjust the viewport as much of the interface > becomes so sluggish it is practically frozen. I had been taking advantage > of the $preview variable to set the other resolution adjusting vars such as > $fs to minimize resolution for previewing and have a high resolution for > rendering. But now I have been manually changing vars to only have high > res for renders before exporting. What I'd really love to have is a way to > do single keystrokes for a preview render, a full render and an export > render (as an obj and not an stl). I expect I will have to build my own > from source to achieve this but thought I would ask in case I am missing > something and other solutions are possible. > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
GS
Guenther Sohler
Mon, Aug 5, 2024 8:37 AM

Additionally, CPU usage is constantly higher, WHILE you are in measuring
mode.
During measuring mode, OpenSCAD is constantly evaluating, which part of
your design is below the mouse cursor.
Press "ESC" to finish measuring mode and return to low cpu usage.

On Mon, Aug 5, 2024 at 9:15 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:

I put a render() call around bits that cause the preview frame rate to
drop. It is much less of a problem with the new rendering system.

On Mon, 5 Aug 2024 at 07:19, Michael Marx (spintel) via Discuss <
discuss@lists.openscad.org> wrote:

Also make sure you have large cache sizes in preferences, re-render will
be quicker.


From: Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org]
Sent: Mon, 5 Aug 2024 14:48
To: Todd Allen
Cc: OpenSCAD general discussion Mailing-list; Chun Kit LAM
Subject: [OpenSCAD] Re: CPU load remains high after previewing but not
after render

If you look at the paper of OpenCSG, which is the backend for preview,
you will see that the Goldfeather algorithm has a complexity of O(n^2).
Even with depth complexity optimization, it is still O(kn). And you need to
do that for each pixel (AFAIK). This is why it is slow.

I think you will have better luck running the actual render and do not
use preview. This may be slower at first, but it does not require running
an expensive shader every frame.

On 5/8/2024 11:39, Todd Allen wrote:

Yes, display performance becomes bearable when preview faceting is kept
very low.  I figured I was running into a bug in OpenSCAD or my graphics
driver as the display is quite responsive at vastly higher numbers of faces
generated by a render.

On Sun, Aug 4, 2024 at 10:20 PM Todd Allen speedebikes@gmail.com wrote:

Yes, just checked it is doing software graphics.  It is possible to use
GPU graphics but it looks like I have a few hoops to jump through.  Why is
displaying a preview so much more demanding than displaying a render?
Anyway for now I'll see if I can get by just making previews very coarse
grained.

On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM john.lck40@gmail.com
wrote:

Do you have GPU passthrough for your VM? When running under
virtualization, it may run under software rendering. And I doubt if
Fusion360 is much more graphically demanding, openscad preview render is
kind of like unoptimized ray-tracing (from my understanding) which is quite
heavy even for good GPUs, and it will definitely stress your CPU when run
under software rendering.

On 5/8/2024 10:43, Todd Allen wrote:

Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
OS is a fully updated Arch linux virtual machine running under Qubes OS
4.2 with pvh virtualization and seamless integration enabled.
I get the same behavior with both a week old unstable release and the
last stable release 2024.01.06 of OpenSCAD, both are .appimage files.

I think the issue may be a graphics driver as the problem got much worse
after switching from a 1080p monitor to a 2560x1440 monitor.

I have a Windows VM which I rarely use to run Fusion360 which is a much
more graphically demanding app and it runs well.  I should try OpenSCAD
there to help isolate if the problem is with the linux graphics driver.
Curiously though when I render the video is smooth and fairly responsive
under linux and it is only when looking at a preview the system chokes.

Here's a sample script which causes this:

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>

$fn= $preview ? 32 : 256;
eps = 0.002;

module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5,
inner_chamfer, outer_chamfer) {
$rod_d = rod_d;
$wall_t = wall_t;
$corner_size = corner_size;
$inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer;
$outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer;
$pipe_d = $rod_d+2*$wall_t;
$flange_t = $wall_t;
$flange_fillet = 1.25*$wall_t;
$corner_cut = $rod_d0.5+$wall_t0.8;
children();
}

module leg(h, d, cb, ct) {
joined_shape = rect([h-$flange_fillet0.6,$flange_t]);
union() {
zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
for(a = [-45,-135]) zrot(a) right($pipe_d
0.5) yrot(90)
down($pipe_d0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d,
length=h
0.6, fillet=$flange_fillet, n=24);
}
}

module leg_core(h, d, cb, ct) {
down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct,
circum=true);
}

module corner() {
ang = acos(1/sqrt(3));
h = $corner_size-$corner_cut;
top_half(s=200) up(h1.04) {
difference() {
zrot_copies(n=3) xrot(ang) down(h
0.5+$corner_cut) leg(h,
$pipe_d, $outer_chamfer, $inner_chamfer);
zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut)
leg_core(h, $rod_d, -$outer_chamfer,0);
// trim bottom outer edge of flange
// figuring out a formula too hard for now so if parameters
change this will need tweaking, probably make these values enviroment vars
zrot_copies(n=3) fwd(14) down(h) xrot(45)
cuboid([26,3,7],anchor=BACK);
}
}
}

// EXAMPLE invocation
setenv_RodFrame() corner();

On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss <
discuss@lists.openscad.org> wrote:

What is the openscad version, as well as OS and hardware spec? Nightly
version is using a different preview pipeline. And this somehow makes me
wonder if you are using software rendering instead of GPU rendering.

On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:

Can you share a picture of your model?

On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, <
discuss@lists.openscad.org> wrote:

I use the render key but the other two are no longer of much use.  If I
can I'll rewrite the <export STL> key to do a render with $export=true
which I can test in script to go higher res and then export an OBJ.

On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:

F5, F6 and F7 do preview, render and export but I think F7 is STL only.

On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

When working with complex high facet models I've turned off automatic
preview and just use rendering because previewing overheats my CPU and
makes it nearly impossible to adjust the viewport as much of the interface
becomes so sluggish it is practically frozen.  I had been taking advantage
of the $preview variable to set the other resolution adjusting vars such as
$fs to minimize resolution for previewing and have a high resolution for
rendering.  But now I have been manually changing vars to only have high
res for renders before exporting.  What I'd really love to have is a way to
do single keystrokes for a preview render, a full render and an export
render (as an obj and not an stl).  I expect I will have to build my own
from source to achieve this but thought I would ask in case I am missing
something and other solutions are possible.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list

To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Additionally, CPU usage is constantly higher, WHILE you are in measuring mode. During measuring mode, OpenSCAD is constantly evaluating, which part of your design is below the mouse cursor. Press "ESC" to finish measuring mode and return to low cpu usage. On Mon, Aug 5, 2024 at 9:15 AM nop head via Discuss < discuss@lists.openscad.org> wrote: > I put a render() call around bits that cause the preview frame rate to > drop. It is much less of a problem with the new rendering system. > > On Mon, 5 Aug 2024 at 07:19, Michael Marx (spintel) via Discuss < > discuss@lists.openscad.org> wrote: > >> Also make sure you have large cache sizes in preferences, re-render will >> be quicker. >> >> >> ------------------------------ >> >> *From:* Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org] >> *Sent:* Mon, 5 Aug 2024 14:48 >> *To:* Todd Allen >> *Cc:* OpenSCAD general discussion Mailing-list; Chun Kit LAM >> *Subject:* [OpenSCAD] Re: CPU load remains high after previewing but not >> after render >> >> >> >> If you look at the paper of OpenCSG, which is the backend for preview, >> you will see that the Goldfeather algorithm has a complexity of O(n^2). >> Even with depth complexity optimization, it is still O(kn). And you need to >> do that for each pixel (AFAIK). This is why it is slow. >> >> I think you will have better luck running the actual render and do not >> use preview. This may be slower at first, but it does not require running >> an expensive shader every frame. >> >> On 5/8/2024 11:39, Todd Allen wrote: >> >> Yes, display performance becomes bearable when preview faceting is kept >> very low. I figured I was running into a bug in OpenSCAD or my graphics >> driver as the display is quite responsive at vastly higher numbers of faces >> generated by a render. >> >> >> >> On Sun, Aug 4, 2024 at 10:20 PM Todd Allen <speedebikes@gmail.com> wrote: >> >> Yes, just checked it is doing software graphics. It is possible to use >> GPU graphics but it looks like I have a few hoops to jump through. Why is >> displaying a preview so much more demanding than displaying a render? >> Anyway for now I'll see if I can get by just making previews very coarse >> grained. >> >> >> >> On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM <john.lck40@gmail.com> >> wrote: >> >> Do you have GPU passthrough for your VM? When running under >> virtualization, it may run under software rendering. And I doubt if >> Fusion360 is much more graphically demanding, openscad preview render is >> kind of like unoptimized ray-tracing (from my understanding) which is quite >> heavy even for good GPUs, and it will definitely stress your CPU when run >> under software rendering. >> >> On 5/8/2024 10:43, Todd Allen wrote: >> >> Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram >> OS is a fully updated Arch linux virtual machine running under Qubes OS >> 4.2 with pvh virtualization and seamless integration enabled. >> I get the same behavior with both a week old unstable release and the >> last stable release 2024.01.06 of OpenSCAD, both are .appimage files. >> >> I think the issue may be a graphics driver as the problem got much worse >> after switching from a 1080p monitor to a 2560x1440 monitor. >> >> I have a Windows VM which I rarely use to run Fusion360 which is a much >> more graphically demanding app and it runs well. I should try OpenSCAD >> there to help isolate if the problem is with the linux graphics driver. >> Curiously though when I render the video is smooth and fairly responsive >> under linux and it is only when looking at a preview the system chokes. >> >> Here's a sample script which causes this: >> >> include <BOSL2/std.scad> >> include <BOSL2/rounding.scad> >> >> $fn= $preview ? 32 : 256; >> eps = 0.002; >> >> module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5, >> inner_chamfer, outer_chamfer) { >> $rod_d = rod_d; >> $wall_t = wall_t; >> $corner_size = corner_size; >> $inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer; >> $outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer; >> $pipe_d = $rod_d+2*$wall_t; >> $flange_t = $wall_t; >> $flange_fillet = 1.25*$wall_t; >> $corner_cut = $rod_d*0.5+$wall_t*0.8; >> children(); >> } >> >> module leg(h, d, cb, ct) { >> joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); >> union() { >> zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); >> for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) yrot(90) >> down($pipe_d*0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d, >> length=h*0.6, fillet=$flange_fillet, n=24); >> } >> } >> >> module leg_core(h, d, cb, ct) { >> down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, >> circum=true); >> } >> >> module corner() { >> ang = acos(1/sqrt(3)); >> h = $corner_size-$corner_cut; >> top_half(s=200) up(h*1.04) { >> difference() { >> zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg(h, >> $pipe_d, $outer_chamfer, $inner_chamfer); >> zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) >> leg_core(h, $rod_d, -$outer_chamfer,0); >> // trim bottom outer edge of flange >> // figuring out a formula too hard for now so if parameters >> change this will need tweaking, probably make these values enviroment vars >> zrot_copies(n=3) fwd(14) down(h) xrot(45) >> cuboid([26,3,7],anchor=BACK); >> } >> } >> } >> >> // EXAMPLE invocation >> setenv_RodFrame() corner(); >> >> >> >> On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss < >> discuss@lists.openscad.org> wrote: >> >> What is the openscad version, as well as OS and hardware spec? Nightly >> version is using a different preview pipeline. And this somehow makes me >> wonder if you are using software rendering instead of GPU rendering. >> >> On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: >> >> Can you share a picture of your model? >> >> >> >> >> >> On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, < >> discuss@lists.openscad.org> wrote: >> >> I use the render key but the other two are no longer of much use. If I >> can I'll rewrite the <export STL> key to do a render with $export=true >> which I can test in script to go higher res and then export an OBJ. >> >> >> >> On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss < >> discuss@lists.openscad.org> wrote: >> >> F5, F6 and F7 do preview, render and export but I think F7 is STL only. >> >> >> >> On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss < >> discuss@lists.openscad.org> wrote: >> >> When working with complex high facet models I've turned off automatic >> preview and just use rendering because previewing overheats my CPU and >> makes it nearly impossible to adjust the viewport as much of the interface >> becomes so sluggish it is practically frozen. I had been taking advantage >> of the $preview variable to set the other resolution adjusting vars such as >> $fs to minimize resolution for previewing and have a high resolution for >> rendering. But now I have been manually changing vars to only have high >> res for renders before exporting. What I'd really love to have is a way to >> do single keystrokes for a preview render, a full render and an export >> render (as an obj and not an stl). I expect I will have to build my own >> from source to achieve this but thought I would ask in case I am missing >> something and other solutions are possible. >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> >> _______________________________________________ >> >> OpenSCAD mailing list >> >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
L
larry
Mon, Aug 5, 2024 7:35 PM

On Sun, 2024-08-04 at 21:43 -0500, Todd Allen via Discuss wrote:

Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
OS is a fully updated Arch linux virtual machine running under Qubes
OS 4.2 with pvh virtualization and seamless integration enabled.
I get the same behavior with both a week old unstable release and the
last stable release 2024.01.06 of OpenSCAD, both are .appimage files.

AMD Ryzen 5 5600G with Radeon Graphics
Ubuntu MATE 22.04 LTS
OpenSCAD version 2024.03.02

Your program:
Compile and preview finished.
Total rendering time: 0:00:00.235

Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using Manifold...
Geometries in cache: 66
Geometry cache size in bytes: 3443032
CGAL Polyhedrons in cache: 23
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.777

I think the issue may be a graphics driver as the problem got much
worse after switching from a 1080p monitor to a 2560x1440 monitor.

I think you're right.

I have a Windows VM which I rarely use to run Fusion360 which is a
much more graphically demanding app and it runs well.  I should try
OpenSCAD there to help isolate if the problem is with the linux
graphics driver.  Curiously though when I render the video is smooth
and fairly responsive under linux and it is only when looking at a
preview the system chokes.

Here's a sample script which causes this:

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>

$fn= $preview ? 32 : 256;
eps = 0.002;

module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26,
chamfer=0.5, inner_chamfer, outer_chamfer) {
    $rod_d = rod_d;
    $wall_t = wall_t;
    $corner_size = corner_size;
    $inner_chamfer = is_undef(inner_chamfer) ? chamfer :
inner_chamfer;
    $outer_chamfer = is_undef(outer_chamfer) ? chamfer :
outer_chamfer;
    $pipe_d = $rod_d+2*$wall_t;
    $flange_t = $wall_t;
    $flange_fillet = 1.25*$wall_t;
    $corner_cut = $rod_d0.5+$wall_t0.8;
    children();
}

module leg(h, d, cb, ct) {
    joined_shape = rect([h-$flange_fillet0.6,$flange_t]);
    union() {
        zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
        for(a = [-45,-135]) zrot(a) right($pipe_d
0.5) yrot(90)
down($pipe_d0.5)
join_prism(joined_shape,base="cylinder",base_d=$pipe_d, length=h
0.6,
fillet=$flange_fillet, n=24);
        }
}

module leg_core(h, d, cb, ct) {
    down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct,
circum=true);
}

module corner() {
    ang = acos(1/sqrt(3));
    h = $corner_size-$corner_cut;
    top_half(s=200) up(h1.04) {
        difference() {
            zrot_copies(n=3) xrot(ang) down(h
0.5+$corner_cut) leg(h,
$pipe_d, $outer_chamfer, $inner_chamfer);
            zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut)
leg_core(h, $rod_d, -$outer_chamfer,0);
            // trim bottom outer edge of flange
            // figuring out a formula too hard for now so if
parameters change this will need tweaking, probably make these values
enviroment vars
            zrot_copies(n=3) fwd(14) down(h) xrot(45)
cuboid([26,3,7],anchor=BACK);
            }
        }
}

// EXAMPLE invocation
setenv_RodFrame() corner();

On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss
discuss@lists.openscad.org wrote:

What is the openscad version, as well as OS and hardware spec?
Nightly version is using a different preview pipeline. And this
somehow makes me wonder if you are using software rendering instead
of GPU rendering.
On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:
 

Can you share a picture of your model?

 
On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss,
discuss@lists.openscad.org wrote:
 

I use the render key but the other two are no longer of much
use.  If I can I'll rewrite the <export STL> key to do a render
with $export=true which I can test in script to go higher res
and then export an OBJ.
 
On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss
discuss@lists.openscad.org wrote:
 

F5, F6 and F7 do preview, render and export but I think F7 is
STL only.
 
On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss
discuss@lists.openscad.org wrote:
 

When working with complex high facet models I've turned off
automatic preview and just use rendering because previewing
overheats my CPU and makes it nearly impossible to adjust
the viewport as much of the interface becomes
so sluggish it is practically frozen.  I had been taking
advantage of the $preview variable to set the other
resolution adjusting vars such as $fs to minimize
resolution for previewing and have a high resolution for
rendering.  But now I have been manually changing vars to
only have high res for renders before exporting.  What I'd
really love to have is a way to do single keystrokes for a
preview render, a full render and an export render (as an
obj and not an stl).  I expect I will have to build my own
from source to achieve this but thought I would ask in case
I am missing something and other solutions are possible.
 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to
discuss-leave@lists.openscad.org

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to
discuss-leave@lists.openscad.org

 _______________________________________________
 OpenSCAD mailing list
 To unsubscribe send an email to
discuss-leave@lists.openscad.org

 
 


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

On Sun, 2024-08-04 at 21:43 -0500, Todd Allen via Discuss wrote: > Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram > OS is a fully updated Arch linux virtual machine running under Qubes > OS 4.2 with pvh virtualization and seamless integration enabled. > I get the same behavior with both a week old unstable release and the > last stable release 2024.01.06 of OpenSCAD, both are .appimage files. AMD Ryzen 5 5600G with Radeon Graphics Ubuntu MATE 22.04 LTS OpenSCAD version 2024.03.02 Your program: Compile and preview finished. Total rendering time: 0:00:00.235 Compiling design (CSG Tree generation)... Rendering Polygon Mesh using Manifold... Geometries in cache: 66 Geometry cache size in bytes: 3443032 CGAL Polyhedrons in cache: 23 CGAL cache size in bytes: 0 Total rendering time: 0:00:00.777 > I think the issue may be a graphics driver as the problem got much > worse after switching from a 1080p monitor to a 2560x1440 monitor. I think you're right. > I have a Windows VM which I rarely use to run Fusion360 which is a > much more graphically demanding app and it runs well.  I should try > OpenSCAD there to help isolate if the problem is with the linux > graphics driver.  Curiously though when I render the video is smooth > and fairly responsive under linux and it is only when looking at a > preview the system chokes. > > Here's a sample script which causes this: > > include <BOSL2/std.scad> > include <BOSL2/rounding.scad> > > $fn= $preview ? 32 : 256; > eps = 0.002; > > module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, > chamfer=0.5, inner_chamfer, outer_chamfer) { >     $rod_d = rod_d; >     $wall_t = wall_t; >     $corner_size = corner_size; >     $inner_chamfer = is_undef(inner_chamfer) ? chamfer : > inner_chamfer; >     $outer_chamfer = is_undef(outer_chamfer) ? chamfer : > outer_chamfer; >     $pipe_d = $rod_d+2*$wall_t; >     $flange_t = $wall_t; >     $flange_fillet = 1.25*$wall_t; >     $corner_cut = $rod_d*0.5+$wall_t*0.8; >     children(); > } > > module leg(h, d, cb, ct) { >     joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); >     union() { >         zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); >         for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) yrot(90) > down($pipe_d*0.5) > join_prism(joined_shape,base="cylinder",base_d=$pipe_d, length=h*0.6, > fillet=$flange_fillet, n=24); >         } > } > > module leg_core(h, d, cb, ct) { >     down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, > circum=true); > } > > module corner() { >     ang = acos(1/sqrt(3)); >     h = $corner_size-$corner_cut; >     top_half(s=200) up(h*1.04) { >         difference() { >             zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg(h, > $pipe_d, $outer_chamfer, $inner_chamfer); >             zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) > leg_core(h, $rod_d, -$outer_chamfer,0); >             // trim bottom outer edge of flange >             // figuring out a formula too hard for now so if > parameters change this will need tweaking, probably make these values > enviroment vars >             zrot_copies(n=3) fwd(14) down(h) xrot(45) > cuboid([26,3,7],anchor=BACK); >             } >         } > } > > // EXAMPLE invocation > setenv_RodFrame() corner(); > > > On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss > <discuss@lists.openscad.org> wrote: > > What is the openscad version, as well as OS and hardware spec? > > Nightly version is using a different preview pipeline. And this > > somehow makes me wonder if you are using software rendering instead > > of GPU rendering. > > On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: > >   > > > Can you share a picture of your model? > > > > > >   > > > On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, > > > <discuss@lists.openscad.org> wrote: > > >   > > > > I use the render key but the other two are no longer of much > > > > use.  If I can I'll rewrite the <export STL> key to do a render > > > > with $export=true which I can test in script to go higher res > > > > and then export an OBJ. > > > >   > > > > On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss > > > > <discuss@lists.openscad.org> wrote: > > > >   > > > > > F5, F6 and F7 do preview, render and export but I think F7 is > > > > > STL only. > > > > >   > > > > > On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss > > > > > <discuss@lists.openscad.org> wrote: > > > > >   > > > > > > When working with complex high facet models I've turned off > > > > > > automatic preview and just use rendering because previewing > > > > > > overheats my CPU and makes it nearly impossible to adjust > > > > > > the viewport as much of the interface becomes > > > > > > so sluggish it is practically frozen.  I had been taking > > > > > > advantage of the $preview variable to set the other > > > > > > resolution adjusting vars such as $fs to minimize > > > > > > resolution for previewing and have a high resolution for > > > > > > rendering.  But now I have been manually changing vars to > > > > > > only have high res for renders before exporting.  What I'd > > > > > > really love to have is a way to do single keystrokes for a > > > > > > preview render, a full render and an export render (as an > > > > > > obj and not an stl).  I expect I will have to build my own > > > > > > from source to achieve this but thought I would ask in case > > > > > > I am missing something and other solutions are possible. > > > > > >  _______________________________________________ > > > > > >  OpenSCAD mailing list > > > > > >  To unsubscribe send an email to > > > > > > discuss-leave@lists.openscad.org > > > > > > > > > > >  _______________________________________________ > > > > >  OpenSCAD mailing list > > > > >  To unsubscribe send an email to > > > > > discuss-leave@lists.openscad.org > > > > > > > > >  _______________________________________________ > > > >  OpenSCAD mailing list > > > >  To unsubscribe send an email to > > > > discuss-leave@lists.openscad.org > > > > > > >   > > >   > > > _______________________________________________ > > > OpenSCAD mailing list > > > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > > OpenSCAD mailing list > > To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
TA
Todd Allen
Mon, Aug 5, 2024 7:35 PM

Thanks!  I never thought to try that.  When I read about render() in the
documentation it wasn't obvious to me when it would be useful and I never
used it.  But after a couple test uses I expect I will use it a  lot.

On Mon, Aug 5, 2024 at 2:15 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:

I put a render() call around bits that cause the preview frame rate to
drop. It is much less of a problem with the new rendering system.

On Mon, 5 Aug 2024 at 07:19, Michael Marx (spintel) via Discuss <
discuss@lists.openscad.org> wrote:

Also make sure you have large cache sizes in preferences, re-render will
be quicker.


From: Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org]
Sent: Mon, 5 Aug 2024 14:48
To: Todd Allen
Cc: OpenSCAD general discussion Mailing-list; Chun Kit LAM
Subject: [OpenSCAD] Re: CPU load remains high after previewing but not
after render

If you look at the paper of OpenCSG, which is the backend for preview,
you will see that the Goldfeather algorithm has a complexity of O(n^2).
Even with depth complexity optimization, it is still O(kn). And you need to
do that for each pixel (AFAIK). This is why it is slow.

I think you will have better luck running the actual render and do not
use preview. This may be slower at first, but it does not require running
an expensive shader every frame.

On 5/8/2024 11:39, Todd Allen wrote:

Yes, display performance becomes bearable when preview faceting is kept
very low.  I figured I was running into a bug in OpenSCAD or my graphics
driver as the display is quite responsive at vastly higher numbers of faces
generated by a render.

On Sun, Aug 4, 2024 at 10:20 PM Todd Allen speedebikes@gmail.com wrote:

Yes, just checked it is doing software graphics.  It is possible to use
GPU graphics but it looks like I have a few hoops to jump through.  Why is
displaying a preview so much more demanding than displaying a render?
Anyway for now I'll see if I can get by just making previews very coarse
grained.

On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM john.lck40@gmail.com
wrote:

Do you have GPU passthrough for your VM? When running under
virtualization, it may run under software rendering. And I doubt if
Fusion360 is much more graphically demanding, openscad preview render is
kind of like unoptimized ray-tracing (from my understanding) which is quite
heavy even for good GPUs, and it will definitely stress your CPU when run
under software rendering.

On 5/8/2024 10:43, Todd Allen wrote:

Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram
OS is a fully updated Arch linux virtual machine running under Qubes OS
4.2 with pvh virtualization and seamless integration enabled.
I get the same behavior with both a week old unstable release and the
last stable release 2024.01.06 of OpenSCAD, both are .appimage files.

I think the issue may be a graphics driver as the problem got much worse
after switching from a 1080p monitor to a 2560x1440 monitor.

I have a Windows VM which I rarely use to run Fusion360 which is a much
more graphically demanding app and it runs well.  I should try OpenSCAD
there to help isolate if the problem is with the linux graphics driver.
Curiously though when I render the video is smooth and fairly responsive
under linux and it is only when looking at a preview the system chokes.

Here's a sample script which causes this:

include <BOSL2/std.scad>
include <BOSL2/rounding.scad>

$fn= $preview ? 32 : 256;
eps = 0.002;

module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5,
inner_chamfer, outer_chamfer) {
$rod_d = rod_d;
$wall_t = wall_t;
$corner_size = corner_size;
$inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer;
$outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer;
$pipe_d = $rod_d+2*$wall_t;
$flange_t = $wall_t;
$flange_fillet = 1.25*$wall_t;
$corner_cut = $rod_d0.5+$wall_t0.8;
children();
}

module leg(h, d, cb, ct) {
joined_shape = rect([h-$flange_fillet0.6,$flange_t]);
union() {
zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true);
for(a = [-45,-135]) zrot(a) right($pipe_d
0.5) yrot(90)
down($pipe_d0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d,
length=h
0.6, fillet=$flange_fillet, n=24);
}
}

module leg_core(h, d, cb, ct) {
down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct,
circum=true);
}

module corner() {
ang = acos(1/sqrt(3));
h = $corner_size-$corner_cut;
top_half(s=200) up(h1.04) {
difference() {
zrot_copies(n=3) xrot(ang) down(h
0.5+$corner_cut) leg(h,
$pipe_d, $outer_chamfer, $inner_chamfer);
zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut)
leg_core(h, $rod_d, -$outer_chamfer,0);
// trim bottom outer edge of flange
// figuring out a formula too hard for now so if parameters
change this will need tweaking, probably make these values enviroment vars
zrot_copies(n=3) fwd(14) down(h) xrot(45)
cuboid([26,3,7],anchor=BACK);
}
}
}

// EXAMPLE invocation
setenv_RodFrame() corner();

On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss <
discuss@lists.openscad.org> wrote:

What is the openscad version, as well as OS and hardware spec? Nightly
version is using a different preview pipeline. And this somehow makes me
wonder if you are using software rendering instead of GPU rendering.

On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote:

Can you share a picture of your model?

On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, <
discuss@lists.openscad.org> wrote:

I use the render key but the other two are no longer of much use.  If I
can I'll rewrite the <export STL> key to do a render with $export=true
which I can test in script to go higher res and then export an OBJ.

On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss <
discuss@lists.openscad.org> wrote:

F5, F6 and F7 do preview, render and export but I think F7 is STL only.

On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss <
discuss@lists.openscad.org> wrote:

When working with complex high facet models I've turned off automatic
preview and just use rendering because previewing overheats my CPU and
makes it nearly impossible to adjust the viewport as much of the interface
becomes so sluggish it is practically frozen.  I had been taking advantage
of the $preview variable to set the other resolution adjusting vars such as
$fs to minimize resolution for previewing and have a high resolution for
rendering.  But now I have been manually changing vars to only have high
res for renders before exporting.  What I'd really love to have is a way to
do single keystrokes for a preview render, a full render and an export
render (as an obj and not an stl).  I expect I will have to build my own
from source to achieve this but thought I would ask in case I am missing
something and other solutions are possible.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list

To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks! I never thought to try that. When I read about render() in the documentation it wasn't obvious to me when it would be useful and I never used it. But after a couple test uses I expect I will use it a lot. On Mon, Aug 5, 2024 at 2:15 AM nop head via Discuss < discuss@lists.openscad.org> wrote: > I put a render() call around bits that cause the preview frame rate to > drop. It is much less of a problem with the new rendering system. > > On Mon, 5 Aug 2024 at 07:19, Michael Marx (spintel) via Discuss < > discuss@lists.openscad.org> wrote: > >> Also make sure you have large cache sizes in preferences, re-render will >> be quicker. >> >> >> ------------------------------ >> >> *From:* Chun Kit LAM via Discuss [mailto:discuss@lists.openscad.org] >> *Sent:* Mon, 5 Aug 2024 14:48 >> *To:* Todd Allen >> *Cc:* OpenSCAD general discussion Mailing-list; Chun Kit LAM >> *Subject:* [OpenSCAD] Re: CPU load remains high after previewing but not >> after render >> >> >> >> If you look at the paper of OpenCSG, which is the backend for preview, >> you will see that the Goldfeather algorithm has a complexity of O(n^2). >> Even with depth complexity optimization, it is still O(kn). And you need to >> do that for each pixel (AFAIK). This is why it is slow. >> >> I think you will have better luck running the actual render and do not >> use preview. This may be slower at first, but it does not require running >> an expensive shader every frame. >> >> On 5/8/2024 11:39, Todd Allen wrote: >> >> Yes, display performance becomes bearable when preview faceting is kept >> very low. I figured I was running into a bug in OpenSCAD or my graphics >> driver as the display is quite responsive at vastly higher numbers of faces >> generated by a render. >> >> >> >> On Sun, Aug 4, 2024 at 10:20 PM Todd Allen <speedebikes@gmail.com> wrote: >> >> Yes, just checked it is doing software graphics. It is possible to use >> GPU graphics but it looks like I have a few hoops to jump through. Why is >> displaying a preview so much more demanding than displaying a render? >> Anyway for now I'll see if I can get by just making previews very coarse >> grained. >> >> >> >> On Sun, Aug 4, 2024 at 10:06 PM Chun Kit LAM <john.lck40@gmail.com> >> wrote: >> >> Do you have GPU passthrough for your VM? When running under >> virtualization, it may run under software rendering. And I doubt if >> Fusion360 is much more graphically demanding, openscad preview render is >> kind of like unoptimized ray-tracing (from my understanding) which is quite >> heavy even for good GPUs, and it will definitely stress your CPU when run >> under software rendering. >> >> On 5/8/2024 10:43, Todd Allen wrote: >> >> Ryzen 9 6900HX w/ AMD Radeon 680M graphics, 32 GB ram >> OS is a fully updated Arch linux virtual machine running under Qubes OS >> 4.2 with pvh virtualization and seamless integration enabled. >> I get the same behavior with both a week old unstable release and the >> last stable release 2024.01.06 of OpenSCAD, both are .appimage files. >> >> I think the issue may be a graphics driver as the problem got much worse >> after switching from a 1080p monitor to a 2560x1440 monitor. >> >> I have a Windows VM which I rarely use to run Fusion360 which is a much >> more graphically demanding app and it runs well. I should try OpenSCAD >> there to help isolate if the problem is with the linux graphics driver. >> Curiously though when I render the video is smooth and fairly responsive >> under linux and it is only when looking at a preview the system chokes. >> >> Here's a sample script which causes this: >> >> include <BOSL2/std.scad> >> include <BOSL2/rounding.scad> >> >> $fn= $preview ? 32 : 256; >> eps = 0.002; >> >> module setenv_RodFrame(rod_d=10, wall_t=2.5, corner_size=26, chamfer=0.5, >> inner_chamfer, outer_chamfer) { >> $rod_d = rod_d; >> $wall_t = wall_t; >> $corner_size = corner_size; >> $inner_chamfer = is_undef(inner_chamfer) ? chamfer : inner_chamfer; >> $outer_chamfer = is_undef(outer_chamfer) ? chamfer : outer_chamfer; >> $pipe_d = $rod_d+2*$wall_t; >> $flange_t = $wall_t; >> $flange_fillet = 1.25*$wall_t; >> $corner_cut = $rod_d*0.5+$wall_t*0.8; >> children(); >> } >> >> module leg(h, d, cb, ct) { >> joined_shape = rect([h-$flange_fillet*0.6,$flange_t]); >> union() { >> zcyl(h=h, d=d, chamfer1=cb, chamfer2=ct, circum=true); >> for(a = [-45,-135]) zrot(a) right($pipe_d*0.5) yrot(90) >> down($pipe_d*0.5) join_prism(joined_shape,base="cylinder",base_d=$pipe_d, >> length=h*0.6, fillet=$flange_fillet, n=24); >> } >> } >> >> module leg_core(h, d, cb, ct) { >> down(eps) zcyl(h=h+10*eps, d=d, chamfer1=cb, chamfer2=ct, >> circum=true); >> } >> >> module corner() { >> ang = acos(1/sqrt(3)); >> h = $corner_size-$corner_cut; >> top_half(s=200) up(h*1.04) { >> difference() { >> zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) leg(h, >> $pipe_d, $outer_chamfer, $inner_chamfer); >> zrot_copies(n=3) xrot(ang) down(h*0.5+$corner_cut) >> leg_core(h, $rod_d, -$outer_chamfer,0); >> // trim bottom outer edge of flange >> // figuring out a formula too hard for now so if parameters >> change this will need tweaking, probably make these values enviroment vars >> zrot_copies(n=3) fwd(14) down(h) xrot(45) >> cuboid([26,3,7],anchor=BACK); >> } >> } >> } >> >> // EXAMPLE invocation >> setenv_RodFrame() corner(); >> >> >> >> On Sun, Aug 4, 2024 at 7:07 PM Chun Kit LAM via Discuss < >> discuss@lists.openscad.org> wrote: >> >> What is the openscad version, as well as OS and hardware spec? Nightly >> version is using a different preview pipeline. And this somehow makes me >> wonder if you are using software rendering instead of GPU rendering. >> >> On 5/8/2024 07:05, Sanjeev Prabhakar via Discuss wrote: >> >> Can you share a picture of your model? >> >> >> >> >> >> On Mon, 5 Aug, 2024, 2:20 am Todd Allen via Discuss, < >> discuss@lists.openscad.org> wrote: >> >> I use the render key but the other two are no longer of much use. If I >> can I'll rewrite the <export STL> key to do a render with $export=true >> which I can test in script to go higher res and then export an OBJ. >> >> >> >> On Sun, Aug 4, 2024 at 11:57 AM nop head via Discuss < >> discuss@lists.openscad.org> wrote: >> >> F5, F6 and F7 do preview, render and export but I think F7 is STL only. >> >> >> >> On Sun, 4 Aug 2024 at 17:44, Todd Allen via Discuss < >> discuss@lists.openscad.org> wrote: >> >> When working with complex high facet models I've turned off automatic >> preview and just use rendering because previewing overheats my CPU and >> makes it nearly impossible to adjust the viewport as much of the interface >> becomes so sluggish it is practically frozen. I had been taking advantage >> of the $preview variable to set the other resolution adjusting vars such as >> $fs to minimize resolution for previewing and have a high resolution for >> rendering. But now I have been manually changing vars to only have high >> res for renders before exporting. What I'd really love to have is a way to >> do single keystrokes for a preview render, a full render and an export >> render (as an obj and not an stl). I expect I will have to build my own >> from source to achieve this but thought I would ask in case I am missing >> something and other solutions are possible. >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> >> _______________________________________________ >> >> OpenSCAD mailing list >> >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TA
Todd Allen
Tue, Aug 6, 2024 2:04 PM

Thanks everyone for all the tips and suggestions!  What previously I feared
was a bug in my video driver or OpenSCAD needing possibly drastic work
arounds such as avoiding preview is merely the normal behavior that is
trivial to cope with now that I understand it.  The issue was only that
refreshing the viewport without using GPU graphics is very CPU intensive
and the load increases as a product of increasing facets in the model AND
the number of pixels in the viewport.  I was frustrated by the OpenSCAD
interface becoming unresponsive when previews were too demanding but in my
case my OS's windows manager hotkeys are unaffected and I can readily
unmaximize or shrink the window with the viewport to resolve inadvertent
overloads.  It would be nice in OpenSCAD if there were hotkeys that could
adjust the sizes of editor and viewport when docked or if those windows
were more fully independent as the console window is when undocked but even
without either of those I can keep previewing in my standard workflow.

Thanks everyone for all the tips and suggestions! What previously I feared was a bug in my video driver or OpenSCAD needing possibly drastic work arounds such as avoiding preview is merely the normal behavior that is trivial to cope with now that I understand it. The issue was only that refreshing the viewport without using GPU graphics is very CPU intensive and the load increases as a product of increasing facets in the model AND the number of pixels in the viewport. I was frustrated by the OpenSCAD interface becoming unresponsive when previews were too demanding but in my case my OS's windows manager hotkeys are unaffected and I can readily unmaximize or shrink the window with the viewport to resolve inadvertent overloads. It would be nice in OpenSCAD if there were hotkeys that could adjust the sizes of editor and viewport when docked or if those windows were more fully independent as the console window is when undocked but even without either of those I can keep previewing in my standard workflow.
TA
Todd Allen
Tue, Aug 6, 2024 2:30 PM

There is an even more trivial escape for inadvertent preview overloads.
Pressing <F10> (View Surfaces) changes the view to a massively more CPU
friendly display refresh.

On Tue, Aug 6, 2024 at 9:04 AM Todd Allen speedebikes@gmail.com wrote:

Thanks everyone for all the tips and suggestions!  What previously I
feared was a bug in my video driver or OpenSCAD needing possibly drastic
work arounds such as avoiding preview is merely the normal behavior that is
trivial to cope with now that I understand it.  The issue was only that
refreshing the viewport without using GPU graphics is very CPU intensive
and the load increases as a product of increasing facets in the model AND
the number of pixels in the viewport.  I was frustrated by the OpenSCAD
interface becoming unresponsive when previews were too demanding but in my
case my OS's windows manager hotkeys are unaffected and I can readily
unmaximize or shrink the window with the viewport to resolve inadvertent
overloads.  It would be nice in OpenSCAD if there were hotkeys that could
adjust the sizes of editor and viewport when docked or if those windows
were more fully independent as the console window is when undocked but even
without either of those I can keep previewing in my standard workflow.

There is an even more trivial escape for inadvertent preview overloads. Pressing <F10> (View Surfaces) changes the view to a massively more CPU friendly display refresh. On Tue, Aug 6, 2024 at 9:04 AM Todd Allen <speedebikes@gmail.com> wrote: > Thanks everyone for all the tips and suggestions! What previously I > feared was a bug in my video driver or OpenSCAD needing possibly drastic > work arounds such as avoiding preview is merely the normal behavior that is > trivial to cope with now that I understand it. The issue was only that > refreshing the viewport without using GPU graphics is very CPU intensive > and the load increases as a product of increasing facets in the model AND > the number of pixels in the viewport. I was frustrated by the OpenSCAD > interface becoming unresponsive when previews were too demanding but in my > case my OS's windows manager hotkeys are unaffected and I can readily > unmaximize or shrink the window with the viewport to resolve inadvertent > overloads. It would be nice in OpenSCAD if there were hotkeys that could > adjust the sizes of editor and viewport when docked or if those windows > were more fully independent as the console window is when undocked but even > without either of those I can keep previewing in my standard workflow. >