View Full Version : Mobius Strip?
dangermouse
20th May 2003, 09:11 pm
Hi everyboby,
This is purely a sitting infront of autocad with nothing better to do question,is it possible to draw a "MOBIUS STRIP" with autocad.
it would be cool to do, have fun trying its baffled me, but then again thats not hard . :!:
always smiling dangermouse :D
fuccaro
21st May 2003, 09:49 am
; MOEBIUS SURFACE
; mfuccaro@hotmail.com
;;;;;;;;;;;;- 21.05.2003 -;
(defun c:mb()
(setq xmax 200 ymax 11;you may change here the dimensions
x 0 rad2 (/ xmax (* 2 PI))
save (list (getvar "osmode") (getvar "cmdecho")))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "3dmesh" (1+ xmax) ymax)
(repeat (1+ xmax)
(setq y (- (/ ymax 2)))
(repeat ymax
(setq ang1 (/ (* x PI) xmax) ;twist along OY
x1 x
y1 (* y (cos ang1))
z1 (* y (sin ang1)))
(setq ang2 (/ (* x1 2 PI) xmax) ;bend on OZ
x2 (* rad2 (sin ang2))
y2 y1
z2 (* (+ rad2 z1) (cos ang2)))
(command (list x2 y2 z2))
(setq y (1+ y)))
(setq x (1+ x)))
(command "vpoint" (list 1 1 1))
(setvar "osmode" (car save))
(setvar "cmdecho" (cadr save))
(princ)
)You may change the xmax and ymax -with Notepad or with any other text editor- but keep the ymax impair.
*** editing ***
As I mentioned before (read bellow) the code must be cleaned before you can use it. Here it goes:
; MOBIUS SURFACE
; mfuccaro@hotmail.com
;;;;;;;;;;;;- 21.05.2003 -;
(defun c:mb()
(setq xmax 200 ymax 11;you may change here the dimensions
x 0 rad2 (/ xmax (* 2 PI))
save (list (getvar "osmode") (getvar "cmdecho")))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "3dmesh" (1+ xmax) ymax)
(repeat (1+ xmax)
(setq y (- (/ ymax 2)))
(repeat ymax
(setq ang1 (/ (* x PI) xmax) ;twist along OY
x1 x
y1 (* y (cos ang1))
z1 (* y (sin ang1)))
(setq ang2 (/ (* x1 2 PI) xmax) ;bend on OZ
x2 (* rad2 (sin ang2))
y2 y1
z2 (* (+ rad2 z1) (cos ang2)))
(command (list x2 y2 z2))
(setq y (1+ y)))
(setq x (1+ x)))
(command "vpoint" (list 1 1 1))
(setvar "osmode" (car save))
(setvar "cmdecho" (cadr save))
(princ)
)
dangermouse
21st May 2003, 06:11 pm
Hi,
absolutly superb, thank you very much indeed.
always smiling dangermouse :D
fuccaro
22nd May 2003, 03:35 am
And here is an image:
http://www.cadimage.net/fuccaro/moebius.gif
CADTutor
22nd May 2003, 08:23 am
Fantastic! Is there no end to this mans talent?
fuccaro
22nd May 2003, 09:54 am
Thank you CADTutor! As always I feel good reading your appreciation. What did you find “fantastic” -the lisp or the image?
The routine is not hard to understand -just a bit of math, especially trigonometry. About 30% of the program lines are for save and restore settings, comments and so. The point is: even a very short program can do the task, for the AutoCAD/AutoLisp it is almost a trivial one.
About the image: The file-size is a bit over the 50k limit you set but as I know I am the first one who published animated images in the Forum. I will not abuse by this in the future. I created some screen-captures viewing the surface from different angles, I edited the images and I have put them together.
CADTutor
22nd May 2003, 04:46 pm
What is most fantastic is the through response to the request. I must admit that my first reaction was, "Mobius Strip in AutoCAD? Don't even go there!" Once again, your rather more pragmatic approach wins the day.
dangermouse
22nd May 2003, 06:49 pm
Hi,
The mobius strip question was more of a challenge for the "BRAINS" and for mear mortals like me to gaze in wonder :o at the results.I must find out where they hand out thease brain things.joking aside i think the way you take a problem and find a solution is great.are there seperate courses for learning lisp routines or is it just a case of knowing computer programming. :D
always smiling dangermouse.
watch this space for the next challenge.
Mr T
22nd May 2003, 08:25 pm
Looks like a strip for about 2/3s then a twisted RULESURF ?????
Nick
fuccaro
23rd May 2003, 06:50 am
Nick
The dimensions are not important. If the Mobius strip is not a commonly used concept: it looks like a ribbon twisted first around its longitudinal axis and than the ends are joined together.
Show us your way to draw the Mobius strip. It will be not the first when you make just with AutoCAD things I created with Lisp.
Mr T
28th May 2003, 10:00 pm
The Power of RULESURF :shock:
1) Draw the outline shape.
2) Draw a '3D polyline' to create the curve profile that twists.
Repeat the '3D polyline' but mirror around 180 degs.
3) Set 'SURFTAB1' to 20, it will create a smoother surface, with 20 segments.
4) RULESURF the 2 3D polylines together.
NB The source is not an ellipse but could be if you wish.
Hey presto, a couple of minutes and a MOBIUS thingymijig !! :roll:
:P Nick
http://www.eezylearn.pwp.blueyonder.co.uk/images/mob1.jpg
http://www.eezylearn.pwp.blueyonder.co.uk/images/mob2.jpg
CADTutor
28th May 2003, 10:32 pm
"Draw a '3D polyline' to create the curve profile that twists."
Hmm... sounds easy when you say it like that but I reckon I'll be sticking with fuccaro's LISP routine should I ever need to draw a Mobius strip.
By the way, in case you were wondering, the strip was named after August Mobius (1790-1868), German mathematician who invented it. :wink:
Mr T
29th May 2003, 10:27 am
If you look at the polyline I have drawn it snapping to an end point then a midpoint then another end point then mirrored it. That was pretty easy. Only three points to draw !
Nick
fuccaro
29th May 2003, 11:02 am
Nick
I was sure you will find a way to do it. But let me ask you: there is a surface or are two surfaces with two common edges creating the ilusion of a single one?
Mr T
30th May 2003, 11:47 am
Nick
I was sure you will find a way to do it. But let me ask you: there is a surface or are two surfaces with two common edges creating the ilusion of a single one?
It's a single twisted rulesurf. Since the two polylines twist when you then create a surface between them the surface is twisted also. A RULESURF is a surface between any two entities
Curve to curve, line to line circle to circle, rectangle to rectangle etc etc. The best thing is it works easily across planes. Unlike the dreaded REGIONs which only work co-planar (same plane ie same XY plane)
Anyway covering a MATHS lesson on mortgages, boring !. Not teaching graphics just now.
Nick
PS I'll do a detailed RULESURF tutorial soon, good weather for rock climbing inthe evenings just now, here in Scotland.
fuccaro
4th Nov 2003, 07:27 am
The mobius thread was interesting to see. I didn't even know what the term meant before now :oops:
Just out of curiousity, what exactly would a mobius be used for?The Mobius strip is a funny object: it has a single surface. Create a Mobius strip from a paper ribbon and put it on the table. Move a pencil along it. You will end up with a continuous closed line. Cut the strip and examine the ribbon: on both of sides you have lines!
On the ancient times I used a printer with an inked ribbon. That ribbon was twisted. In this way it was used on both of sides (longer life).
Other utilities of the Mobius strip? Somebody else?
Mr T
6th Nov 2003, 10:29 pm
I suppose you could design a double edged V belt used in car engines for drive belts etc and have it twisted as above to improve the life.
Nick
robfowler
6th Nov 2003, 10:58 pm
How about endless toilet paper :lol:
Rob.
fuccaro
8th Nov 2003, 07:54 am
Rob
This is an ... interesting way to... save paper. Saving paper we will save the trees. We will have more oxygen for our planet and we will live longer. I am sure that your paper saving invention has nothing to do with the fact that you are Scottish! :D
Mr T
8th Nov 2003, 10:28 am
I am sure that your paper saving invention has nothing to do with the fact that you are Scottish! :D
oh no not the scottish jokes pleeese.
Nick
(Scottish n proud of it)
fuccaro
8th Nov 2003, 11:45 am
No offense, my Scottish friends. Just some sense of humor ple(eee)ase, if it is possible!
Mr T
8th Nov 2003, 05:23 pm
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
gcp310
9th Nov 2003, 11:18 am
Lets wait to the Rugby World Cup results for some humour. :lol:
Not looking so far for you UK folks??
G
fuccaro
18th Oct 2004, 06:00 am
For a solid Mobius strip:
http://www.cadimage.net/fuccaro/mob0.png
;| 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":
;| 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))
)
)
stupens
10th Nov 2004, 05:55 am
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! :)
fuccaro
10th Nov 2004, 07:47 am
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!
fuccaro
11th Nov 2004, 11:16 am
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.
http://www.cadimage.net/fuccaro/telto1.png
http://www.cadimage.net/fuccaro/telto2.png
Just for fun:
http://www.cadimage.net/fuccaro/telto3.png
; 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:
; 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)
)
hyposmurf
11th Nov 2004, 01:46 pm
Nice work Fuccaro :wink:
stupens
11th Nov 2004, 07:31 pm
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. :oops:
The kind of surfaces I need to model have an elliptical plan such as these:
http://www.geocities.com/s_ricaurte/Major_Axis.jpg
http://www.geocities.com/s_ricaurte/Minor_Axis.jpg
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.
http://www.geocities.com/s_ricaurte/Max_Model.jpg
And this is the corresponding geometry at the core, in plan and elevation...
http://www.geocities.com/s_ricaurte/Max_Strip.jpg
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! 8)
fuccaro
15th Nov 2004, 07:20 am
These are with rectangular cross section and eliptycal path:
http://www.cadimage.net/fuccaro/telto4.png
http://www.cadimage.net/fuccaro/telto5.png
(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:
(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)
)
a1harps
24th Nov 2004, 01:51 am
Mr Fuccaro. You have been defined so many ways in this forum. I would
say that you havent merely mastered the the craft of computer drawing
but that you are what I consider an artist. It is a privilege to to see what you can create and then give to others so freely.
Frank
fuccaro
24th Nov 2004, 07:52 am
Dear Mr. Frank
I didn’t offer the result of my work for free; you will have to spend your precious time to test my routines to see if they work for you. :)
Now serious: I tried to teach AutoCAD to draw things sometimes so easy to draw in other CAD programs. I find that the Lisp is a powerfully language and the AutoCAD-Lisp combination gives you even more power.
I feel good reading your appreciation, thank you!
a1harps
24th Nov 2004, 10:44 pm
Mr Fuccaro,
I know this isnt the chat section but I am curious. If other drafting programs can do easily what you are doing inAutocad then why use
Autocad at all? Autocad is the the only drafting software I have access to.
Are you saying the other ones are superior to straight Autocad, but
Autocad coupled with lisp routones is superior to the others?
Frank
fuccaro
25th Nov 2004, 07:29 am
If other drafting programs can do easily what you are doing inAutocad then why use Autocad at all? Autocad is the the only drafting software I have access to.
Frank, you posted a question AND the answer too!
Are you saying the other ones are superior to straight Autocad [...]?
Ask Mr T! :D
My answer:
AutoCAD can be used in many fields. It is a general CAD software -created initially for architects. I do mechanical jobs and I see others working in Catia, SolidWorks and ProEngineering. I see things I can not do in AutoCAD but these things are also a source for inspiration for my Lisp routines.
Autocad coupled with lisp routones is superior to the others?
Let me quote Hendie for the answer:
Yes, Anything (almost) is possible if you have enough time and energy and knowledge to see it through.
Mr Fuccaro
You are a family member now. Call me simple: Sir! :D
Moesian
7th May 2005, 02:05 pm
Hi,
Does anyone know of a way to export all the points of a mobius mesh or mobius solid to a text file?
Thanks
Moesian
fuccaro
9th May 2005, 07:53 am
Two ways coming up in my mind:
1. Modify the existing routine to write the points in a file as it calculates them
2. To write a lisp to export the points from a mesh. To export the solid points is more complicated.
Try this:
; MOEBIUS SURFACE
; mfuccaro@hotmail.com
;;;;;;;;;;;;- 21.05.2003 -;
; revisions: save the points in a text file May 2005
;
(defun c:mb( / file xmax ymax x y x1 y1 z1 x2 y2 z2 rad2 save ang2)
(setq file (open (getfiled "Output file" "" "TXT" 5) "w"))
(setq xmax 50 ymax 5 ;you may change here the dimensions
x 0 rad2 (/ xmax (* 2 PI))
save (list (getvar "osmode") (getvar "cmdecho")))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "3dmesh" (1+ xmax) ymax)
(repeat (1+ xmax)
(setq y (- (/ ymax 2)))
(repeat ymax
(setq ang1 (/ (* x PI) xmax) ;twist along OY
x1 x
y1 (* y (cos ang1))
z1 (* y (sin ang1)))
(setq ang2 (/ (* x1 2 PI) xmax) ;bend on OZ
x2 (* rad2 (sin ang2))
y2 y1
z2 (* (+ rad2 z1) (cos ang2)))
(command (list x2 y2 z2))
(write-line (strcat (rtos x2) "," (rtos y2) "," (rtos z2)) file)
(setq y (1+ y)))
(setq x (1+ x)))
(close file)
(command "vpoint" (list 1 1 1))
(setvar "osmode" (car save))
(setvar "cmdecho" (cadr save))
(princ)
)
*** editing ***
The clean code:
; MOBIUS SURFACE
; mfuccaro@hotmail.com
;;;;;;;;;;;;- 21.05.2003 -;
; revisions: save the points in a text file May 2005
;
(defun c:mb( / file xmax ymax x y x1 y1 z1 x2 y2 z2 rad2 save ang2)
(setq file (open (getfiled "Output file" "" "TXT" 5) "w"))
(setq xmax 50 ymax 5 ;you may change here the dimensions
x 0 rad2 (/ xmax (* 2 PI))
save (list (getvar "osmode") (getvar "cmdecho")))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(command "3dmesh" (1+ xmax) ymax)
(repeat (1+ xmax)
(setq y (- (/ ymax 2)))
(repeat ymax
(setq ang1 (/ (* x PI) xmax) ;twist along OY
x1 x
y1 (* y (cos ang1))
z1 (* y (sin ang1)))
(setq ang2 (/ (* x1 2 PI) xmax) ;bend on OZ
x2 (* rad2 (sin ang2))
y2 y1
z2 (* (+ rad2 z1) (cos ang2)))
(command (list x2 y2 z2))
(write-line (strcat (rtos x2) "," (rtos y2) "," (rtos z2)) file)
(setq y (1+ y)))
(setq x (1+ x)))
(close file)
(command "vpoint" (list 1 1 1))
(setvar "osmode" (car save))
(setvar "cmdecho" (cadr save))
(princ)
)
Moesian
9th May 2005, 02:44 pm
Cheers fuccaro,
Havent tried this yet but looks like its what I need. Think I might have a go at trying to get the solid point export lisp done myself. Not sure if ill succeed but Ill post it here if I do. Havent really got any experience with lisp so looks bleek. Do you know of any good tutorials on Autolisp programming?
fuccaro
10th May 2005, 06:09 am
Cheers fuccaro,
[...] looks like its what I need. Good! Just for my curiousity: what do you need?
For learning Lisp try the Afralisp site.
Gilbert
9th Mar 2009, 07:27 pm
I need help drawing a mobius strip about 12" long by 1" wide, I see that there a lot of talent here please help. 10686
fuccaro
10th Mar 2009, 07:16 am
Welcome in the forum, Gilbert!
I wrote the Mobius lisp in the dark era of pre2007 AutoCAD. These days people may use Loft and Sweep, this brought major changes in modelling, including the possibility to draw a Mobius strip just from AutoCAD.
But if you wish to play: see the routine I posted years ago, on the first page of this thread. Also CADTutor published instructions about how to use Lisp routines. In the routine itself are some instructions about changing the dimensions of the Mobius strip. So... draw one and scale it until it fits your needs. Good luck, post again if you have problems.
accademia
27th Nov 2011, 08:53 pm
hi guys!
i would like to (better said i have to) create a moebius strip for a university project. i found this site, but have never used lisps before. so i also searched for an introduction, but it couldn't get it fixed...
so please can somebody tell me what i am doing wrong?
- i saved the script with notepad and named the file something with .lsp as ending
- then i either loaded the lsp through tools > load autolisp or by draging the file on the drawing frame. autocad tells me that the lsp is loaded successfully
- afterwards i have to start the script through typing the name of the function, which is written after "defun c:" and in this case it is mb, right?
because here autocad tells me that this function doesn't exist...
please can somebody help me soon ;-) i would also be fine just by having a .dxf or .dwg of one moebius-strip.
thank you!
fuccaro
29th Nov 2011, 07:18 am
The program text is affected by a character coding problem. These days you don't need Lisp to draw Mobius strips! I wrote the programs while in AutoCAD 2006 (and I still use that version) but in AutoCAD 2010 you have new commands and more possibilities. I will try to update the functions sometime during the next week.
Welcome in the forum!
fuccaro
29th Nov 2011, 09:39 pm
I am a little bit surprised to see the interest renewed for this pretty old thread. Well, I spent some time adjusting the program text. Years ago Dangermouse started this thread... Dangermouse, can you read this? are you still alive?
Dadgad
1st Dec 2011, 07:49 am
As previously stated by Fuccaro, these days you can make the moebius strip or model using the sweep command, without developing a Lisp. open your modeling toolbar and give it a go, using twist value 180 it is really straight ahead, in a rather convoluted and unilateral way.
khoshravan
1st Dec 2011, 12:28 pm
As previously stated by Fuccaro, these days you can make the moebius strip or model using the sweep command, without developing a Lisp. open your modeling toolbar and give it a go, using twist value 180 it is really straight ahead, in a rather convoluted and unilateral way.
Is it possible in Acad2010?
Dadgad
1st Dec 2011, 01:32 pm
I believe so, but I do not have it, cannot check for you.
khoshravan
1st Dec 2011, 04:43 pm
I believe so, but I do not have it, cannot check for you.
In which version have you done it?
SLW210
1st Dec 2011, 05:31 pm
In which version have you done it?
Any version AutoCAD 2007 and newer will do this.
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.