<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Equation based surface using 3DPLOT in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258791#M133067</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got the same shape,I double checked the equations in the lisp format and are right (I think), so the problem it seems to come from 3DPLOT or the equations, may be someone can jump to this thread an bring some ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the parameters and step, they come from the mathematical parametrization itself, 0 &amp;lt; u &amp;lt; 2pi; 0 &amp;lt; v &amp;lt; 2pi, the step i first choose, one degree, &amp;nbsp;was to much for my low spec notebook, so i changed to some more reasonable value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a simpler function to play with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun KleinB(u v / cu cv cu2 su2 su sv sq)&lt;BR /&gt; (setq cu (cos u))&lt;BR /&gt; (setq cv (cos v))&lt;BR /&gt; (setq cu2 (cos (/ u 2)))&lt;BR /&gt; (setq su2 (sin (/ u 2)))&lt;BR /&gt; (setq su (sin u))&lt;BR /&gt; (setq sv (sin v))&lt;BR /&gt; (setq sq (+ (sqrt 2) cv))&lt;BR /&gt; (setq KBX (* cu (+ (* cu2 sq) (* su2 sv cv))))&lt;BR /&gt; (setq KBY (* su (+ (* cu2 sq) (* su2 sv cv))))&lt;BR /&gt; (setq KBZ (+ (* (* -1 su2) sq) (* cu2 sv cv)))&lt;BR /&gt; (list KBX KBY KBZ)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;(defun C:KB2(/ umax vmax stepu stepv)&lt;BR /&gt; (setq umax (getreal "\nU Parameter Max Value:"))&lt;BR /&gt; (setq vmax (getreal "\nV Parameter Max Value:"))&lt;BR /&gt; (setq stepU (getreal "\nU Parameter Step:"))&lt;BR /&gt; (setq stepV (getreal "\nV Parameter Step:"))&lt;BR /&gt; (3DPlot KleinB 0 umax stepU 0 vmax stepV)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some info here:&amp;nbsp;&lt;A href="http://mathworld.wolfram.com/KleinBottle.html" target="_blank"&gt;http://mathworld.wolfram.com/KleinBottle.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2016 03:27:03 GMT</pubDate>
    <dc:creator>hgasty1001</dc:creator>
    <dc:date>2016-04-08T03:27:03Z</dc:date>
    <item>
      <title>Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6253527#M133058</link>
      <description>&lt;P&gt;Hello all, I am trying to create a custom surface LISP for the 3DPLOT utility, specifically a Klein&amp;nbsp;Bottle. &lt;A href="http://www.cadstudio.cz/en/apps/3dplot/" target="_blank"&gt;Here&lt;/A&gt; is a link to there website. The equation is&amp;nbsp;&amp;nbsp;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/229783iABC2581DCD23CE95/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="Klein bottle.PNG" title="Klein bottle.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the surface should look like this (more or less).&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/229784i767A69D781BC0B40/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="Klein Bottle.PNG" title="Klein Bottle.PNG" /&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Even if some one could help me to at least write the equations in LISP form, I wold greatly appreciate&amp;nbsp;that!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it helps I'm currently using AutoCAD 2013 and 2015.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;-Ryan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 01:33:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6253527#M133058</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-06T01:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6253655#M133059</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure, but try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun KleinX(u v)&lt;BR /&gt; (* (cos u)(+ (* cos (/ u 2) (+ (sqrt 2) (cos v))) (* (sin (/ u 2)) (sin u) (sin v))) &lt;BR /&gt; )&lt;BR /&gt; &lt;BR /&gt; (defun KleinY(u v)&lt;BR /&gt; (* (cos u)(+ (* sin (/ u 2) (+ (sqrt 2) (cos v))) (* (sin (/ u 2)) (sin u) (sin v))))&lt;BR /&gt; )&lt;BR /&gt; &lt;BR /&gt; (defun KleinZ(u v)&lt;BR /&gt; (- (* (cos (/ u 2)) (sin v) (cos v)) (* sin (/ u 2) (+ (sqrt 2) (cos v))))&lt;BR /&gt; )&lt;/P&gt;
&lt;P&gt;(defun KelinBottle(u v)&lt;BR /&gt; (list (KleinX u v) (KleinY u v) (KleinZ u v))&lt;BR /&gt;) &lt;BR /&gt; ;;(3DPlot functionName startU endU stepU startV endV stepV)&lt;BR /&gt;(3DPlot KleinBottle 0 (* 2 pi) (/ (* 2 pi) 360) 0 (* 2 pi) (/ (* 2 pi) 360))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2016 04:52:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6253655#M133059</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-06T04:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258059#M133060</link>
      <description>&lt;P&gt;Thank you!! I'll give it a shot and let you know if it works.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 18:07:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258059#M133060</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-07T18:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258080#M133061</link>
      <description>Nope didn't work... Here is a snip of the command dialog box when i insert the lisp.</description>
      <pubDate>Thu, 07 Apr 2016 18:21:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258080#M133061</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-07T18:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258631#M133062</link>
      <description>&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230421i7E4A86CA35E9383C/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="klein error.PNG" title="klein error.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 23:08:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258631#M133062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-07T23:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258668#M133063</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You only need the "C:xxx" with lisp implemented commands (that's why the "C:", C as &lt;FONT color="#FF0000"&gt;C&lt;/FONT&gt;ommand), if you need to call commands as &amp;nbsp;functions, you need to call it this way: (C:xxx) without parameters, as lisp implemented commands doesn't support parameters (arguments). So just copy the text from my post to the command line and see if it works calling the function exactly as it was posted:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;3DPlot KleinBottle 0 (* 2 pi) (/ (* 2 pi) 360) 0 (* 2 pi) (/ (* 2 pi) 360)))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If does, then you can implement a command like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun C:KB()(&lt;SPAN&gt;3DPlot KleinBottle 0 (* 2 pi) (/ (* 2 pi) 360) 0 (* 2 pi) (/ (* 2 pi) 360)))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And just type KB at the command prompt.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Gaston Nunez&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2016 23:49:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258668#M133063</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-07T23:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258694#M133064</link>
      <description>&lt;P&gt;I had tried that originally but it didnt work. It seems to want more in formation. in order to end it i have to imput a para ")". here are some more sinps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for the help!&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230433iF2A8A923D4C3244B/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="klein error.PNG" title="klein error.PNG" /&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230434iB84EA47E6ED34CB4/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="klein error2.PNG" title="klein error2.PNG" /&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230435iF7A61726B7570C69/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="klein error3.PNG" title="klein error3.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 00:25:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258694#M133064</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T00:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258759#M133065</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry the code was bad formated and had a lot of errors, this should work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun KleinX(u v)&lt;BR /&gt; (* (cos u)(+ (* (cos (/ u 2)) (+ (sqrt 2) (cos v))) (* (sin (/ u 2)) (sin u) (sin v))))&lt;BR /&gt; )&lt;BR /&gt; &lt;BR /&gt; (defun KleinY(u v)&lt;BR /&gt; (* (cos u) (+ (* (sin (/ u 2)) (+ (sqrt 2) (cos v))) (* (sin (/ u 2)) (sin u) (sin v))))&lt;BR /&gt; )&lt;BR /&gt; &lt;BR /&gt; (defun KleinZ(u v)&lt;BR /&gt; (- (* (cos (/ u 2)) (sin v) (cos v)) (* (sin (/ u 2)) (+ (sqrt 2) (cos v))))&lt;BR /&gt; )&lt;/P&gt;
&lt;P&gt;(defun KleinBottle(u v)&lt;BR /&gt; (list (KleinX u v) (KleinY u v) (KleinZ u v))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;(defun C:KB()&lt;BR /&gt; (3DPlot KleinBottle 0 (* 2 pi) 0.1 0 (* 2 pi) 0.1)&lt;BR /&gt;) &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 02:22:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258759#M133065</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-08T02:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258770#M133066</link>
      <description>&lt;P&gt;I was wondering about the step part of that. Didn't get a Klein Bottle but there was a shape! now I just need to do some fine tuning&amp;nbsp;I guess.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you explain&amp;nbsp;to me how you chose the interval and steps for the last part of the lisp?&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230441i668DDA23DE935EE8/image-size/medium?v=lz-1&amp;amp;px=-1" border="0" alt="Klein  Bottle.PNG" title="Klein  Bottle.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 02:46:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258770#M133066</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T02:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258791#M133067</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I got the same shape,I double checked the equations in the lisp format and are right (I think), so the problem it seems to come from 3DPLOT or the equations, may be someone can jump to this thread an bring some ideas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the parameters and step, they come from the mathematical parametrization itself, 0 &amp;lt; u &amp;lt; 2pi; 0 &amp;lt; v &amp;lt; 2pi, the step i first choose, one degree, &amp;nbsp;was to much for my low spec notebook, so i changed to some more reasonable value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is a simpler function to play with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun KleinB(u v / cu cv cu2 su2 su sv sq)&lt;BR /&gt; (setq cu (cos u))&lt;BR /&gt; (setq cv (cos v))&lt;BR /&gt; (setq cu2 (cos (/ u 2)))&lt;BR /&gt; (setq su2 (sin (/ u 2)))&lt;BR /&gt; (setq su (sin u))&lt;BR /&gt; (setq sv (sin v))&lt;BR /&gt; (setq sq (+ (sqrt 2) cv))&lt;BR /&gt; (setq KBX (* cu (+ (* cu2 sq) (* su2 sv cv))))&lt;BR /&gt; (setq KBY (* su (+ (* cu2 sq) (* su2 sv cv))))&lt;BR /&gt; (setq KBZ (+ (* (* -1 su2) sq) (* cu2 sv cv)))&lt;BR /&gt; (list KBX KBY KBZ)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;(defun C:KB2(/ umax vmax stepu stepv)&lt;BR /&gt; (setq umax (getreal "\nU Parameter Max Value:"))&lt;BR /&gt; (setq vmax (getreal "\nV Parameter Max Value:"))&lt;BR /&gt; (setq stepU (getreal "\nU Parameter Step:"))&lt;BR /&gt; (setq stepV (getreal "\nV Parameter Step:"))&lt;BR /&gt; (3DPlot KleinB 0 umax stepU 0 vmax stepV)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some info here:&amp;nbsp;&lt;A href="http://mathworld.wolfram.com/KleinBottle.html" target="_blank"&gt;http://mathworld.wolfram.com/KleinBottle.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 03:27:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258791#M133067</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-08T03:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258799#M133068</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that the equations are not the needed ones, this article from Wikipedia bring some light:&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Klein_bottle." target="_blank"&gt;https://en.wikipedia.org/wiki/Klein_bottle.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 03:33:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258799#M133068</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-08T03:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258891#M133069</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The attached file have a new version that works. It's not best KB I've seen, but it's one.&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230470i367FE84D9628F6F1/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="KB.PNG" title="KB.PNG" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 05:58:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258891#M133069</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-08T05:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258955#M133070</link>
      <description>&lt;P&gt;Ill look into that link. there could be something wrong with the equation. just seeing how to write it in lisp form is very helpful though.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/230488i0DFF084A6AB2A757/image-size/medium?v=lz-1&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 06:46:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258955#M133070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T06:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258957#M133071</link>
      <description>&lt;P&gt;Thats actually where i got the equations from.&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 06:47:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6258957#M133071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T06:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6260134#M133072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm no multiplying by 0, the Lisp syntax&amp;nbsp;use the prefix notation, while most other languages&amp;nbsp;use infix (an there exist the&amp;nbsp;postfix notation like the reverse polish notation in the HP calculators)&amp;nbsp;, that means that you put first the operation intended and then the operands or arguments for the mathematical expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This in the usual&amp;nbsp;way: X + Y translate to (+ X Y) in Lisp notation and syntax, the same for all the others math operations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X - Y -&amp;gt; (- X Y)&lt;/P&gt;
&lt;P&gt;X:Y -&amp;gt; (/ X Y)&lt;/P&gt;
&lt;P&gt;X*Y -&amp;gt; (* X Y)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each math operator takes 2 or more arguments separated by space, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X + Y + Z -&amp;gt; (+ X Y Z)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The usual preceding order of evaluation is given by the parenthesis nesting of&amp;nbsp;the operations, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X*(Y + Z) -&amp;gt; (* X (+ Y Z)):=(+ (* X Y) (* X Z))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each Lisp function (operators in this case) , not only math operators, must be preceded by a parenthesis that you must close at proper&amp;nbsp;position in order to give the correct math meaning to the expression just like the usual way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a lot more on Lisp syntax, but with that you have a start point translating usual (infix) notation to Lisp&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 16:35:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6260134#M133072</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2016-04-08T16:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6260478#M133073</link>
      <description>&lt;P&gt;okay got it thank you. Ive known about how to write basic math function in lisp form but i kept messing up writing last part of this lisp.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2016 18:46:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/6260478#M133073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-08T18:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/7110835#M133074</link>
      <description>&lt;P&gt;Are you sure the equations are right? Transcripting them to LISP gives the following shape:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun KleinX(u v)&lt;BR /&gt;(* (cos u)(+ (* (cos (/ u 2.0)) (+ (sqrt 2.0) (cos v))) (* (sin (/ u 2.0)) (sin v) (cos v))))&lt;BR /&gt;)&lt;BR /&gt;(defun KleinY(u v)&lt;BR /&gt;(* (sin u) (+ (* (cos (/ u 2.0)) (+ (sqrt 2.0) (cos v))) (* (sin (/ u 2.0)) (sin v) (cos v))))&lt;BR /&gt;)&lt;BR /&gt;(defun KleinZ(u v)&lt;BR /&gt;(- (* (cos (/ u 2.0)) (sin v) (cos v)) (* (sin (/ u 2.0)) (+ (sqrt 2.0) (cos v))))&lt;BR /&gt;)&lt;BR /&gt;(defun KleinBottle(u v)&lt;BR /&gt;(list (KleinX u v) (KleinY u v) (KleinZ u v))&lt;BR /&gt;)&lt;BR /&gt;(defun C:KB()&lt;BR /&gt;(3DPlot KleinBottle 0 (* 2.0 pi) 0.1 0 (* 2.0 pi) 0.1)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="klein.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360469iD46F3B5C1126376D/image-size/large?v=v2&amp;amp;px=999" role="button" title="klein.png" alt="klein.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vladimir Michl, &lt;A href="http://www.cadstudio.cz" target="_blank"&gt;www.cadstudio.cz&lt;/A&gt; &amp;nbsp;&lt;A href="http://www.cadforum.cz" target="_blank"&gt;www.cadforum.cz&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 10:10:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/7110835#M133074</guid>
      <dc:creator>vladimir_michl</dc:creator>
      <dc:date>2017-05-26T10:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Equation based surface using 3DPLOT</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/7112557#M133075</link>
      <description>&lt;P&gt;I have found better equations which work also in 3DPlot. Here is the LISP code and the resulting model:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun KleinX(u v)
 (if (&amp;lt; v pi)         (* (- 2.5 (* 1.5 (cos v))) (cos u))
  (if (&amp;lt; v (* 2.0 pi)) (* (- 2.5 (* 1.5 (cos v))) (cos u))
   (if (&amp;lt; v (* 3.0 pi)) (- (* (+ 2.0 (cos u)) (cos v)) 2.0)
					      (- (* 2.0 (cos v)) 2.0 (cos u))
 )))
)
(defun KleinY(u v)
 (if (&amp;lt; v pi)         (* (- 2.5 (* 1.5 (cos v))) (sin u))
  (if (&amp;lt; v (* 2.0 pi)) (* (- 2.5 (* 1.5 (cos v))) (sin u))
   (if (&amp;lt; v (* 3.0 pi)) (sin u)
					      (sin u)
 )))
)
(defun KleinZ(u v)
 (if (&amp;lt; v pi)         (* -2.5 (sin v))
  (if (&amp;lt; v (* 2.0 pi)) (- (* 3.0 v)(* 3.0 pi))
   (if (&amp;lt; v (* 3.0 pi)) (+ (* (+ 2.0 (cos u))(sin v)) (* 3.0 pi))
					      (- (* 12.0 pi) (* 3.0 v))
 )))
)
(defun KleinBottle(u v)
(list (KleinX u v) (KleinY u v) (KleinZ u v))
)
(defun C:KB()
(3DPlot KleinBottle 0.0 (* 2.0 pi)(/ pi 36.0) 0.0 (* 4.0 pi) (/ pi 36.0))
)
&lt;/PRE&gt;
&lt;P&gt;3D DWG:&amp;nbsp;&lt;A href="http://www.cadforum.cz/catalog_en/block.asp?blk=15126" target="_blank"&gt;http://www.cadforum.cz/catalog_en/block.asp?blk=15126&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kleinbottle.png" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/360756i86D4646C7B8FD538/image-size/large?v=v2&amp;amp;px=999" role="button" title="kleinbottle.png" alt="kleinbottle.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vladimir Michl, &lt;A href="http://www.cadstudio.cz" target="_blank"&gt;www.cadstudio.cz&lt;/A&gt; &amp;nbsp;&lt;A href="http://www.cadforum.cz" target="_blank"&gt;www.cadforum.cz&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 07:46:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/equation-based-surface-using-3dplot/m-p/7112557#M133075</guid>
      <dc:creator>vladimir_michl</dc:creator>
      <dc:date>2017-05-27T07:46:17Z</dc:date>
    </item>
  </channel>
</rss>

