discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Generated Points Working During Preview But Not During Render

NS
Nathan Sokalski
Sat, Sep 2, 2023 5:22 AM

I have a function that generates & returns an array of points, which I use in a module. During preview, this works & displays as expected, but when rendering the module is not displayed. It does not give an error, it simply does not display. If I use a literal array of points rather than generating them everything works fine in both preview & render. I have confirmed that the function returns what I expect using echo. Why does the literal always work but the function only works during preview?

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com

I have a function that generates & returns an array of points, which I use in a module. During preview, this works & displays as expected, but when rendering the module is not displayed. It does not give an error, it simply does not display. If I use a literal array of points rather than generating them everything works fine in both preview & render. I have confirmed that the function returns what I expect using echo. Why does the literal always work but the function only works during preview? Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com>
SP
Sanjeev Prabhakar
Sat, Sep 2, 2023 5:30 AM

Can you please share how did you generate the list of points.

On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, njsokalski@hotmail.com
wrote:

I have a function that generates & returns an array of points, which I use
in a module. During preview, this works & displays as expected, but when
rendering the module is not displayed. It does not give an error, it simply
does not display. If I use a literal array of points rather than generating
them everything works fine in both preview & render. I have confirmed that
the function returns what I expect using echo. Why does the literal always
work but the function only works during preview?

Nathan Sokalski
njsokalski@hotmail.com


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

Can you please share how did you generate the list of points. On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.com> wrote: > I have a function that generates & returns an array of points, which I use > in a module. During preview, this works & displays as expected, but when > rendering the module is not displayed. It does not give an error, it simply > does not display. If I use a literal array of points rather than generating > them everything works fine in both preview & render. I have confirmed that > the function returns what I expect using echo. Why does the literal always > work but the function only works during preview? > > Nathan Sokalski > njsokalski@hotmail.com > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
NS
Nathan Sokalski
Sat, Sep 2, 2023 5:41 AM

The exact code of my function is as follows:

function GetBaseFramePerimeter()=
      let(xchange=hexsidesizecos(30),ychange=hexsidesizesin(30))
      AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53cos(60),53sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]);

However, something that I just tried that seems to solve the problem was removing render() from the code. I don't know why this would affect it, but I guess it's a temporary solution.

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com


From: Sanjeev Prabhakar sprabhakar2006@gmail.com
Sent: Saturday, September 2, 2023 1:30 AM
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not During Render

Can you please share how did you generate the list of points.

On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.commailto:njsokalski@hotmail.com> wrote:
I have a function that generates & returns an array of points, which I use in a module. During preview, this works & displays as expected, but when rendering the module is not displayed. It does not give an error, it simply does not display. If I use a literal array of points rather than generating them everything works fine in both preview & render. I have confirmed that the function returns what I expect using echo. Why does the literal always work but the function only works during preview?

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com


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

The exact code of my function is as follows: function GetBaseFramePerimeter()=       let(xchange=hexsidesize*cos(30),ychange=hexsidesize*sin(30))       AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53*cos(60),53*sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]); However, something that I just tried that seems to solve the problem was removing render() from the code. I don't know why this would affect it, but I guess it's a temporary solution. Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com> ________________________________ From: Sanjeev Prabhakar <sprabhakar2006@gmail.com> Sent: Saturday, September 2, 2023 1:30 AM To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org> Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not During Render Can you please share how did you generate the list of points. On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.com<mailto:njsokalski@hotmail.com>> wrote: I have a function that generates & returns an array of points, which I use in a module. During preview, this works & displays as expected, but when rendering the module is not displayed. It does not give an error, it simply does not display. If I use a literal array of points rather than generating them everything works fine in both preview & render. I have confirmed that the function returns what I expect using echo. Why does the literal always work but the function only works during preview? Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com> _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org<mailto:discuss-leave@lists.openscad.org>
NS
Nathan Sokalski
Sat, Sep 2, 2023 5:45 AM

Just in case anybody is wondering, all the variables & functions in this function are from other code that I have written, but they are obviously not the problem since this returns the desired/expected values

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com


From: Nathan Sokalski njsokalski@hotmail.com
Sent: Saturday, September 2, 2023 1:41 AM
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not During Render

The exact code of my function is as follows:

function GetBaseFramePerimeter()=
      let(xchange=hexsidesizecos(30),ychange=hexsidesizesin(30))
      AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53cos(60),53sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]);

However, something that I just tried that seems to solve the problem was removing render() from the code. I don't know why this would affect it, but I guess it's a temporary solution.

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com


From: Sanjeev Prabhakar sprabhakar2006@gmail.com
Sent: Saturday, September 2, 2023 1:30 AM
To: OpenSCAD general discussion Mailing-list discuss@lists.openscad.org
Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not During Render

Can you please share how did you generate the list of points.

On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.commailto:njsokalski@hotmail.com> wrote:
I have a function that generates & returns an array of points, which I use in a module. During preview, this works & displays as expected, but when rendering the module is not displayed. It does not give an error, it simply does not display. If I use a literal array of points rather than generating them everything works fine in both preview & render. I have confirmed that the function returns what I expect using echo. Why does the literal always work but the function only works during preview?

Nathan Sokalski
njsokalski@hotmail.commailto:njsokalski@hotmail.com


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

Just in case anybody is wondering, all the variables & functions in this function are from other code that I have written, but they are obviously not the problem since this returns the desired/expected values Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com> ________________________________ From: Nathan Sokalski <njsokalski@hotmail.com> Sent: Saturday, September 2, 2023 1:41 AM To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org> Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not During Render The exact code of my function is as follows: function GetBaseFramePerimeter()=       let(xchange=hexsidesize*cos(30),ychange=hexsidesize*sin(30))       AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53*cos(60),53*sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]); However, something that I just tried that seems to solve the problem was removing render() from the code. I don't know why this would affect it, but I guess it's a temporary solution. Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com> ________________________________ From: Sanjeev Prabhakar <sprabhakar2006@gmail.com> Sent: Saturday, September 2, 2023 1:30 AM To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org> Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not During Render Can you please share how did you generate the list of points. On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.com<mailto:njsokalski@hotmail.com>> wrote: I have a function that generates & returns an array of points, which I use in a module. During preview, this works & displays as expected, but when rendering the module is not displayed. It does not give an error, it simply does not display. If I use a literal array of points rather than generating them everything works fine in both preview & render. I have confirmed that the function returns what I expect using echo. Why does the literal always work but the function only works during preview? Nathan Sokalski njsokalski@hotmail.com<mailto:njsokalski@hotmail.com> _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org<mailto:discuss-leave@lists.openscad.org>
SP
Sanjeev Prabhakar
Sat, Sep 2, 2023 5:54 AM

It's difficult for me to understand this.
Anyway you have already figured out the issue it seems

On Sat, 2 Sept 2023 at 11:11, Nathan Sokalski njsokalski@hotmail.com
wrote:

The exact code of my function is as follows:

function GetBaseFramePerimeter()=
let(xchange=hexsidesizecos(30),ychange=hexsidesizesin(30))

AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53cos(60),53sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]);

However, something that I just tried that seems to solve the problem was
removing render() from the code. I don't know why this would affect it, but
I guess it's a temporary solution.

Nathan Sokalski
njsokalski@hotmail.com

From: Sanjeev Prabhakar sprabhakar2006@gmail.com
Sent: Saturday, September 2, 2023 1:30 AM
To: OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org

Subject: [OpenSCAD] Re: Generated Points Working During Preview But Not
During Render

Can you please share how did you generate the list of points.

On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, njsokalski@hotmail.com
wrote:

I have a function that generates & returns an array of points, which I use
in a module. During preview, this works & displays as expected, but when
rendering the module is not displayed. It does not give an error, it simply
does not display. If I use a literal array of points rather than generating
them everything works fine in both preview & render. I have confirmed that
the function returns what I expect using echo. Why does the literal always
work but the function only works during preview?

Nathan Sokalski
njsokalski@hotmail.com


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

It's difficult for me to understand this. Anyway you have already figured out the issue it seems On Sat, 2 Sept 2023 at 11:11, Nathan Sokalski <njsokalski@hotmail.com> wrote: > The exact code of my function is as follows: > > function GetBaseFramePerimeter()= > let(xchange=hexsidesize*cos(30),ychange=hexsidesize*sin(30)) > > AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53*cos(60),53*sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]); > > However, something that I just tried that seems to solve the problem was > removing render() from the code. I don't know why this would affect it, but > I guess it's a temporary solution. > > Nathan Sokalski > njsokalski@hotmail.com > ------------------------------ > *From:* Sanjeev Prabhakar <sprabhakar2006@gmail.com> > *Sent:* Saturday, September 2, 2023 1:30 AM > *To:* OpenSCAD general discussion Mailing-list <discuss@lists.openscad.org > > > *Subject:* [OpenSCAD] Re: Generated Points Working During Preview But Not > During Render > > Can you please share how did you generate the list of points. > > > > On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.com> > wrote: > > I have a function that generates & returns an array of points, which I use > in a module. During preview, this works & displays as expected, but when > rendering the module is not displayed. It does not give an error, it simply > does not display. If I use a literal array of points rather than generating > them everything works fine in both preview & render. I have confirmed that > the function returns what I expect using echo. Why does the literal always > work but the function only works during preview? > > Nathan Sokalski > njsokalski@hotmail.com > _______________________________________________ > 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 >
AM
Adrian Mariano
Sat, Sep 2, 2023 12:38 PM

I don't think he has figured out the problem, actually.  If you want help
with your problem you need to post COMPLETE code that others can run.

His problem is that he's created an invalid object that CGAL doesn't like.
That means it can preview but not render.  Putting an explicit render()
invoked CGAL and exposed the behavior.  If he never wants to render then he
can continue onward, but if he wants more than a preview image, he needs to
figure out why his object is invalid and fix it.  Nobody can tell this with
just a code fragment.

On Sat, Sep 2, 2023 at 1:55 AM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

It's difficult for me to understand this.
Anyway you have already figured out the issue it seems

On Sat, 2 Sept 2023 at 11:11, Nathan Sokalski njsokalski@hotmail.com
wrote:

The exact code of my function is as follows:

function GetBaseFramePerimeter()=
let(xchange=hexsidesizecos(30),ychange=hexsidesizesin(30))

AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53cos(60),53sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]);

However, something that I just tried that seems to solve the problem was
removing render() from the code. I don't know why this would affect it, but
I guess it's a temporary solution.

Nathan Sokalski
njsokalski@hotmail.com

From: Sanjeev Prabhakar sprabhakar2006@gmail.com
Sent: Saturday, September 2, 2023 1:30 AM
To: OpenSCAD general discussion Mailing-list <
discuss@lists.openscad.org>
Subject: [OpenSCAD] Re: Generated Points Working During Preview But
Not During Render

Can you please share how did you generate the list of points.

On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, njsokalski@hotmail.com
wrote:

I have a function that generates & returns an array of points, which I
use in a module. During preview, this works & displays as expected, but
when rendering the module is not displayed. It does not give an error, it
simply does not display. If I use a literal array of points rather than
generating them everything works fine in both preview & render. I have
confirmed that the function returns what I expect using echo. Why does the
literal always work but the function only works during preview?

Nathan Sokalski
njsokalski@hotmail.com


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 don't think he has figured out the problem, actually. If you want help with your problem you need to post COMPLETE code that others can run. His problem is that he's created an invalid object that CGAL doesn't like. That means it can preview but not render. Putting an explicit render() invoked CGAL and exposed the behavior. If he never wants to render then he can continue onward, but if he wants more than a preview image, he needs to figure out why his object is invalid and fix it. Nobody can tell this with just a code fragment. On Sat, Sep 2, 2023 at 1:55 AM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > It's difficult for me to understand this. > Anyway you have already figured out the issue it seems > > On Sat, 2 Sept 2023 at 11:11, Nathan Sokalski <njsokalski@hotmail.com> > wrote: > >> The exact code of my function is as follows: >> >> function GetBaseFramePerimeter()= >> let(xchange=hexsidesize*cos(30),ychange=hexsidesize*sin(30)) >> >> AlignPoints(points=RelativeToAbsolutePoints([[framelinksize.x,hexsidesize],[0,(framelinksize.y-hexsidesize)/2],[-framelinksize.x,0],[0,-framelinksize.y],[framelinksize.x,0],[0,(framelinksize.y-hexsidesize)/2],[211,0],[53*cos(60),53*sin(60)],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange],[-xchange,-ychange],[-xchange,ychange]]),alignto=[0,0]); >> >> However, something that I just tried that seems to solve the problem was >> removing render() from the code. I don't know why this would affect it, but >> I guess it's a temporary solution. >> >> Nathan Sokalski >> njsokalski@hotmail.com >> ------------------------------ >> *From:* Sanjeev Prabhakar <sprabhakar2006@gmail.com> >> *Sent:* Saturday, September 2, 2023 1:30 AM >> *To:* OpenSCAD general discussion Mailing-list < >> discuss@lists.openscad.org> >> *Subject:* [OpenSCAD] Re: Generated Points Working During Preview But >> Not During Render >> >> Can you please share how did you generate the list of points. >> >> >> >> On Sat, 2 Sept, 2023, 10:52 am Nathan Sokalski, <njsokalski@hotmail.com> >> wrote: >> >> I have a function that generates & returns an array of points, which I >> use in a module. During preview, this works & displays as expected, but >> when rendering the module is not displayed. It does not give an error, it >> simply does not display. If I use a literal array of points rather than >> generating them everything works fine in both preview & render. I have >> confirmed that the function returns what I expect using echo. Why does the >> literal always work but the function only works during preview? >> >> Nathan Sokalski >> njsokalski@hotmail.com >> _______________________________________________ >> 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 >
JB
Jordan Brown
Mon, Sep 4, 2023 8:58 PM

On 9/2/2023 5:38 AM, Adrian Mariano wrote:

His problem is that he's created an invalid object that CGAL doesn't
like.  That means it can preview but not render. 

Yeah.  One of the most common problem cases is that you've created (or
imported via STL) a polyhedron that is in some subtle way flawed. 
Preview works fine.  Render of just that polyhedron works fine (because
it doesn't deeply involve CGAL).  It's only when you try to combine that
polyhedron with something else - even something as simple as a cube that
doesn't touch it - that the flaws start to cause problems.

On 9/2/2023 5:38 AM, Adrian Mariano wrote: > His problem is that he's created an invalid object that CGAL doesn't > like.  That means it can preview but not render.  Yeah.  One of the most common problem cases is that you've created (or imported via STL) a polyhedron that is in some subtle way flawed.  Preview works fine.  Render of just that polyhedron works fine (because it doesn't deeply involve CGAL).  It's only when you try to combine that polyhedron with something else - even something as simple as a cube that doesn't touch it - that the flaws start to cause problems.