+ Reply to Thread
Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 48

Thread: Mobius Strip?

  1. #21
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,540

    Default

    Registered forum members do not see this ad.

    No offense, my Scottish friends. Just some sense of humor ple(eee)ase, if it is possible!
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  2. #22
    Super Member Mr T's Avatar
    Using
    AutoCAD 2007
    Join Date
    Nov 2002
    Location
    Loch Oich SCOTLAND...
    Posts
    1,641

    Default

    Quote Originally Posted by fuccaro
    No offense, my Scottish friends. Just some sense of humor ple(eee)ase, if it is possible!
    Ah it's ok. The funny thing is that on average scots give more to charity than their british counterparts.

    Nick
    http://www.flickr.com/photos/80049703@N00/ http://mtbnick.fotopic.net/
    http://s240.photobucket.com/albums/ff241/dyNick_Scots/
    http://designgraphicsshowcase.blogspot.com/

    High School Classroom - 21 AutoCAD 2007, Inventor 11, COREL Draw & Paint 11. Very Unreliable Network.

    Home - AMD 2.1GHZ - 512Ram, 64 Video,
    Laptop Inventor 7, Autocad 2004, Corel 11

  3. #23
    Super Member gcp310's Avatar
    Using
    not applicable
    Join Date
    Dec 2002
    Location
    physicaly - Australia, mentaly - Another Planet
    Posts
    696

    Default

    Lets wait to the Rugby World Cup results for some humour.

    Not looking so far for you UK folks??

    G

  4. #24
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,540

    Default

    For a solid Mobius strip:


    Code:
    ;|    Solid Mobius strip
        mfuccaro@hotmail.com
    ------------------------------October, 2004 ----------|;
    
    (defun c:mobius( / w h r ang0 ang1 ang2 c0 N0 N1 N2 segs lx ly ss)
    
      (setq w 1        ;width of cross section
        h 60        ;height
        r 75        ;inner radius
        segs 80        ;number of segments
        )
      ; prepare the screen
      (command "vpoint" "1,1,-1")
      (command "box" (list (setq lx (+ r w h)) (setq ly (max w h)) lx)
                (list (- lx) (- ly) (- lx)))
      (command "zoom" "e")
      (entdel (entlast))
      (setq osmode (getvar "osmode"))
      (setvar "osmode" 0)
      (setq ang0 (/ PI segs)
        c0 (list (+ r (/ w 2.0)) 0 0)
        N0 (list
             (list r (/ h -2.0) 0)
             (list (+ r w) (/ h -2.0) 0)
             (list (+ r w) (/ h 2.0) 0)
             (list r (/ h 2.0) 0))
        ang1 (- ang0))
      (setq ss (ssadd))
      (repeat segs
        (setq ang1 (+ ang1 ang0)
          ang2 (+ ang1 ang0)
          N1 (tw_rot N0 c0 ang1)
          N2 (tw_rot N0 c0 ang2))
        (draw_solid N1 N2)
        (ssadd (entlast) ss)
        )
      (command "union" ss "")
      (setvar "osmode" osmode)
      (princ)
      )
      
    (defun tw_rot (N c ang)
      ;twists a cross section N around C with angle ANG
      ;than rotates the twisted section around OY with angle 2*ANG
      (mapcar '(lambda (p)
             (list (* (car p) (sin (* 2.0 ang))) (cadr p) (* (car p) (cos (* 2.0 ang)))))
          (mapcar '(lambda (p) (polar c (+ ang (angle p c)) (distance p c))) N))
      )
    
    (defun draw_solid (N1 N2 / maxx maxy maxz minx miny minz i j k)
      ; Draws the bounding box of the two consecutive cross sections N1 and N2
      (setq N12 (append N1 N2)
        maxx (apply 'max (mapcar 'car N12))
        minx (apply 'min (mapcar 'car N12))
        maxy (apply 'max (mapcar 'cadr N12))
        miny (apply 'min (mapcar 'cadr N12))
        maxz (apply 'max (mapcar 'caddr N12))
        minz (apply 'min (mapcar 'caddr N12)))
      (command "box" (list minx miny minz) (list maxx maxy maxz))
      ; The box is sliced according to the two sections
      (command "slice" "l" "" (car N1) (cadr N1) (caddr N1) (car N2))
      (command "slice" "l" "" (car N2) (cadr N2) (caddr N2) (car N1))
      (setq i -1)
      (repeat 4
        (setq i (1+ i))
        (setq j (if (= i 3) 0 (1+ i)))
        (setq k (if (= j 3) 0 (1+ j)))
        (command "slice" "l" "" (nth i N1) (nth i N2) (nth j N1) (nth k N1))
        (command "slice" "l" "" (nth j N1) (nth j N2) (nth i N2) (nth k N2))
        )
      )
    *** editing ***
    the "clean code":
    Code:
    ;|    Solid Mobius strip
        mfuccaro@hotmail.com
    ------------------------------October, 2004 ----------|;
    
    (defun c:mobius( / w h r ang0 ang1 ang2 c0 N0 N1 N2 segs lx ly ss)
    
      (setq w 1        ;width of cross section
        h 60        ;height
        r 75        ;inner radius
        segs 80        ;number of segments
        )
      ; prepare the screen
      (command "vpoint" "1,1,-1")
      (command "box" (list (setq lx (+ r w h)) (setq ly (max w h)) lx)
                (list (- lx) (- ly) (- lx)))
      (command "zoom" "e")
      (entdel (entlast))
      (setq osmode (getvar "osmode"))
      (setvar "osmode" 0)
      (setq ang0 (/ PI segs)
        c0 (list (+ r (/ w 2.0)) 0 0)
        N0 (list
             (list r (/ h -2.0) 0)
             (list (+ r w) (/ h -2.0) 0)
             (list (+ r w) (/ h 2.0) 0)
             (list r (/ h 2.0) 0))
        ang1 (- ang0))
      (setq ss (ssadd))
      (repeat segs
        (setq ang1 (+ ang1 ang0)
          ang2 (+ ang1 ang0)
          N1 (tw_rot N0 c0 ang1)
          N2 (tw_rot N0 c0 ang2))
        (draw_solid N1 N2)
        (ssadd (entlast) ss)
        )
      (command "union" ss "")
      (setvar "osmode" osmode)
      (princ)
      )
      
    (defun tw_rot (N c ang)
      ;twists a cross section N around C with angle ANG
      ;than rotates the twisted section around OY with angle 2*ANG
      (mapcar '(lambda (p)
             (list (* (car p) (sin (* 2.0 ang))) (cadr p) (* (car p) (cos (* 2.0 ang)))))
          (mapcar '(lambda (p) (polar c (+ ang (angle p c)) (distance p c))) N))
      )
    
    (defun draw_solid (N1 N2 / maxx maxy maxz minx miny minz i j k)
      ; Draws the bounding box of the two consecutive cross sections N1 and N2
      (setq N12 (append N1 N2)
        maxx (apply 'max (mapcar 'car N12))
        minx (apply 'min (mapcar 'car N12))
        maxy (apply 'max (mapcar 'cadr N12))
        miny (apply 'min (mapcar 'cadr N12))
        maxz (apply 'max (mapcar 'caddr N12))
        minz (apply 'min (mapcar 'caddr N12)))
      (command "box" (list minx miny minz) (list maxx maxy maxz))
      ; The box is sliced according to the two sections
      (command "slice" "l" "" (car N1) (cadr N1) (caddr N1) (car N2))
      (command "slice" "l" "" (car N2) (cadr N2) (caddr N2) (car N1))
      (setq i -1)
      (repeat 4
        (setq i (1+ i))
        (setq j (if (= i 3) 0 (1+ i)))
        (setq k (if (= j 3) 0 (1+ j)))
        (command "slice" "l" "" (nth i N1) (nth i N2) (nth j N1) (nth k N1))
        (command "slice" "l" "" (nth j N1) (nth j N2) (nth i N2) (nth k N2))
        )
      )
    Last edited by fuccaro; 29th Nov 2011 at 09:25 pm. Reason: cleaning the character coding error
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  5. #25
    stupens
    Guest

    Default Mobius Strip with elliptical section.

    Hello everyone!

    I've just joined the CADTutor community and I must thank everyone for their efforts in passing on AutoCAD knowledge. Excellent website!

    In particular, I want to thank Fuccaro for his Mobius Surface routine which has proven extremely useful.

    However, I don´t know a thing about the AutoLisp language; and I want to modify this routine to generate a Mobius Strip with an elliptical section instead of a circular one.

    I need to create strips with both major and minor axis perpendicular to the folding point and be able to modify this dimensions. Any thoughts on how can this be accomplished?

    Thanks in advance!

  6. #26
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,540

    Default

    Hello Stupens!
    I thought that the Mobius strip is a theoretical thing -I am surprised to see this big interest. Well, I wrote the programs for fun and I provided no options for changing the shape, the radius and the other parameters. Changes must be operated in the program.
    I will look what I can do but not these days. Sorry!
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  7. #27
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,540

    Default

    OK, here it is!
    The cross section is eliptycal.
    But let's call it "Twisted thorus" or so because it is not a Mobius strip any more.
    It is more complex as the previous one. As solid it would take forever to be generated, so I created it as a surface. It looks smoothr too.



    Just for fun:

    Code:
    ; Twisted ELiptycal Thorus
    ;    mfuccaro@hotmail.com
    ;------------------------------ November 2004 ----
    (defun c:telto( / r0 r1 r2 sg a0 a1 l0 l1 osmode)
      (setq r0 (getreal "\nbase radius R0 ")
        r1 (getreal "    Major radius R1 ")
        r2 (getreal "    minor radius R2 "))
      (setq sg 40    ;surface quality
        a0 0.0 a1 (/ PI (1- sg) 0.5) st (list r0 0) l0 nil)
      (mapcar 'setvar '("osmode" "cmdecho") '(0 0))
      (command "3DMESH" sg sg)
      (setq osmode (getvar "OSMODE"))
      (repeat sg
        (setq l0 (cons (list (+ r0 (* r1 (cos (setq a0 (+ a0 a1))))) (* r2 (sin a0))) l0)))
    ; l0 contains the points of the ellipse
      (setq a0 0.0)
      (repeat sg
        (setq a0 (+ a0 a1) l1 nil)
        (foreach p l0
        (setq l1 (cons (polar st (+ (* 0.5 a0) (angle st p)) (distance st p)) l1))
          )
    ; l1 is the l0 cross section twised
        (foreach p l1
          (command (list (* (sin a0) (car p)) (cadr p) (* (cos a0) (car p))))
    ; l1 is rotated around OZ and sent to AutoCAD
          )
        )
      (setvar "OSMODE" osmode)
      )
    *** editing ***
    The cleaned code:
    Code:
    ; Twisted ELiptycal Thorus
    ;    mfuccaro@hotmail.com
    ;------------------------------ November 2004 ----
    (defun c:telto( / r0 r1 r2 sg a0 a1 l0 l1 osmode)
      (setq r0 (getreal "\nbase radius R0 ")
        r1 (getreal "    Major radius R1 ")
        r2 (getreal "    minor radius R2 "))
      (setq sg 40    ;surface quality
        a0 0.0 a1 (/ PI (1- sg) 0.5) st (list r0 0) l0 nil)
      (mapcar 'setvar '("osmode" "cmdecho") '(0 0))
      (command "3DMESH" sg sg)
      (setq osmode (getvar "OSMODE"))
      (repeat sg
        (setq l0 (cons (list (+ r0 (* r1 (cos (setq a0 (+ a0 a1))))) (* r2 (sin a0))) l0)))
    ; l0 contains the points of the ellipse
      (setq a0 0.0)
      (repeat sg
        (setq a0 (+ a0 a1) l1 nil)
        (foreach p l0
        (setq l1 (cons (polar st (+ (* 0.5 a0) (angle st p)) (distance st p)) l1))
          )
    ; l1 is the l0 cross section twised
        (foreach p l1
          (command (list (* (sin a0) (car p)) (cadr p) (* (cos a0) (car p))))
    ; l1 is rotated around OZ and sent to AutoCAD
          )
        )
      (setvar "OSMODE" osmode)
      )
    Last edited by fuccaro; 29th Nov 2011 at 09:28 pm. Reason: cleaning the character coding error
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  8. #28
    Super Member
    Using
    Architectural DT 2007
    Join Date
    Dec 2002
    Location
    London
    Posts
    1,087

    Default

    Nice work Fuccaro

  9. #29
    stupens
    Guest

    Default Oops!

    Hello Fuccaro!

    First of all I must say I look at your talent in awe and wonder...
    How have you acquired all of this knowledge?

    I thank you very much for your time and effort, but I must admit I didn't explain myself accurately:

    ...and I want to modify this routine to generate a Möbius Strip with an elliptical section instead of a circular one...
    I used the term "section" meaning the plan of the strip instead of the cross section. Sorry, my mistake.

    The kind of surfaces I need to model have an elliptical plan such as these:




    You might wonder why all the interest in Möbius Bands?

    I'm an architecture student currently analizing the Max Reinhardt Haus project by Peter Eisenman. This project designed in 1992, unbuilt; is based upon the development of surfaces based on a Mobius Strip.



    And this is the corresponding geometry at the core, in plan and elevation...



    Notice how the "interior ellipse" is off-centered from the "exterior" one?
    If I can configure the strip, i'll be able to recreate the volume that defines the surface of the building. (if I can rotate the planes according to the constant turn of the band, that is...)

    Anyway, this work is due next tuesday and I'm running short. I'm going to focus on finishing the rest of the analysis first and i'll leave the 3d model as a bonus if there's some extra time left.

    Once again, thank you for your time and patience.
    I'm sure the Twisted Torus will become famous...

    Keep up the good work!

  10. #30
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,540

    Default

    Registered forum members do not see this ad.

    These are with rectangular cross section and eliptycal path:


    Code:
    (defun c:project( / r1 r2 w h sg l0 lt lr ld a0 a1 orig osmode)
    ; by Fuccaro Miklos -November 2005
    ;
      (setq r1 (getreal "\n minor radius ")
        r2 (getreal "   MAJOR radius ")
        w (* 0.5 (getreal "\nCROSS SECTION: width "))
        h (* 0.5 (getreal "   height")))
      (setq sg 100 tw0 (/ PI 4))
      ; sg = 3...256
      (setq l0 (list (list (- w) (- h))
             (list w (- h))
             (list w h)
             (list (- w) h))
    ; l0= point list; cross section in "neutral position"
        a1 (/ pi (1- sg)) a0 (- a1)
        orig '(0 0))
      (setq osmode (getvar "OSMODE"))
      (mapcar 'setvar '("cmdecho" "osmode") '(0 0))
      (command "3dmesh" sg 5)
      (repeat sg
        (setq a0 (+ a0 a1))
        (setq lt (mapcar '(lambda (p)
                (polar orig (+ (angle orig p) (* 0.5 a0) tw0) (distance orig p)))
                 l0))
    ; lt=point list; the cross section is twisted
        (setq lr (mapcar '(lambda (p)
                (list (* (car p) (cos a0))
                      (cadr p)
                      (* (car p) (sin a0))))
                 lt))
    ; lr=point list; the twisted cross section is rotated around OY
        (setq ld (mapcar '(lambda (p)
                (list (+ (car p) (* r1 (cos a0)))
                      (cadr p)
                      (+ (caddr p) (* r2 (sin a0)))))
                 lr))
    ; ld=point list; lr moved in place
        (foreach p ld (command p))
        (command (car ld))
        )
      (setvar "osmode" osmode)
      )
    *** editing ***
    The cleaned code:
    Code:
    (defun c:project( / r1 r2 w h sg l0 lt lr ld a0 a1 orig osmode)
    ; by Fuccaro Miklos -November 2005
    ;
      (setq r1 (getreal "\n minor radius ")
        r2 (getreal "   MAJOR radius ")
        w (* 0.5 (getreal "\nCROSS SECTION: width "))
        h (* 0.5 (getreal "   height")))
      (setq sg 100 tw0 (/ PI 4))
      ; sg = 3...256
      (setq l0 (list (list (- w) (- h))
             (list w (- h))
             (list w h)
             (list (- w) h))
    ; l0= point list; cross section in "neutral position"
        a1 (/ pi (1- sg)) a0 (- a1)
        orig '(0 0))
      (setq osmode (getvar "OSMODE"))
      (mapcar 'setvar '("cmdecho" "osmode") '(0 0))
      (command "3dmesh" sg 5)
      (repeat sg
        (setq a0 (+ a0 a1))
        (setq lt (mapcar '(lambda (p)
                (polar orig (+ (angle orig p) (* 0.5 a0) tw0) (distance orig p)))
                 l0))
    ; lt=point list; the cross section is twisted
        (setq lr (mapcar '(lambda (p)
                (list (* (car p) (cos a0))
                      (cadr p)
                      (* (car p) (sin a0))))
                 lt))
    ; lr=point list; the twisted cross section is rotated around OY
        (setq ld (mapcar '(lambda (p)
                (list (+ (car p) (* r1 (cos a0)))
                      (cadr p)
                      (+ (caddr p) (* r2 (sin a0)))))
                 lr))
    ; ld=point list; lr moved in place
        (foreach p ld (command p))
        (command (car ld))
        )
      (setvar "osmode" osmode)
      )
    Last edited by fuccaro; 29th Nov 2011 at 09:30 pm. Reason: cleaning the character coding error
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

Similar Threads

  1. Mobius Strip Solid
    By Moesian in forum AutoCAD 3D Modelling & Rendering
    Replies: 12
    Last Post: 7th Jun 2008, 03:39 pm
  2. mobius strip/ ellipse plan
    By fightchrisback in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 13th Nov 2006, 09:25 pm
  3. strip light
    By lukas in forum AutoCAD 3D Modelling & Rendering
    Replies: 1
    Last Post: 10th Dec 2005, 08:02 pm
  4. want to creat helical strip
    By deepak1uw in forum AutoCAD General
    Replies: 1
    Last Post: 9th Nov 2005, 05:46 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts