TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: AVCAD on October 14, 2005, 05:06:37 PM
-
ok I have a area of an ellipse and need to draw it in cad to see if I can fit some cables through it.
The area I have is
.008 sq. in (5.16mm2)
I know you get area by
Length*width
and an Ellipses area by
3.14(pi) * L* w
but if I have the area already whow go I get the Lengths and the width so that I can draw it correctly?
any help would would rock!
EDIT:
Old subject: Here a good one....
New Subject: Dimensions of an ellipse based on area
Changed By : Se7en
-
First off, May I ask that we change the subject of your thread. (The subject does not match your question.) This will help you get the help you requested.
-
sure thing
-
Do you know the aspect ratio? Because "sqrt" will return a sqaure dimension?
-
Like 7 said you need more information - the aspect ratio. Otherwise thar are infinite shaped ellipses that will have that area.
I think you meant Pi x L/2 x W/2 = Area
Solve for L x W = 0.008 X 4 / Pi
L x W = 0.10
so for example L=0.5, W= 0.2 would be a solution
-
hmmm...aspect ratio....
good one. I dont know it. Big problem.
I guess I would need the L and the W to figure this out huh.
Why some one drills a ellipise for a hole is beyond me....expecially when you need to fit cabling through it.
-
Well what are the holes in and what are the cables for. (My first guess for an eliptical hole would be for "sway". So that if the ''widget'' shifts the cables are not sheared because of off-center holes.)
-
the cables are for telecommunitcations. Cat6 cables and what not. they gave a .008sq.in ellipes hole to fit .5" worth of cat6 cables.....good game Architects.
-
Boy I'm scratching my head on this one.
If you have a 0.5" square inches
This is larger that the 0.008 area given for the ellipse, no workie.
Assuming an average Cat 6 cable size of .26” dia.
Area of cable is PI times radius squared
(* pi (* 0.13 0.13))
area = 0.0530929
therefore you have (/ 0.5 0.0530929) or 9.41746 cables
Unless they are figuring in the required free area needed.
Industry standard and NEC code is to design for 40% fill. I think.
In that case you will need (* area (/ 1 0.40)) or 0.132732 sq in of area per cable
this would allow (/ 0.5 0.132732) or 3.76699 cables in the 0.5" area
Not sure how the 0.008 sq in figures in?
Lets say you need to accommodate 0.5" of cable area. The you will need
(* area (/ 1 0.40)) or 1.25 sq in of area in the oval
Given the area of the oval is (* pi (/ H 2.0) (/ W 2.0))
then (/ (/ area pi) (/ H 2.0)) = (/ W 2)
(* 2 (/ (/ area pi) (/ H 2.0))) = W
using an area of 1.25 & a height of 1
(* 2 (/ (/ 1.25 pi) (/ 1 2.0))) = 1.59155 WIDTH
So you need an oval 1 by 1.59155 <--<< correction
But you need a starting height or width or aspect ratio to solve the problem.
-
*shifty eyes* ummm...what he ^ said.
-
uh....ya ... what he ^^ said.... :| :| :|
maybe I will print that out and give it to the designer....
-
Avcad.....when you do give it to him, let us know if he sits there scratching his head like we are....... :loco: :ugly: :ugly:
-
When all else fails write a Lisp for it. :-)
(defun c:avellipse (/ area wd len)
(if (and
(setq area (getdist "\nEnter the area of the ellipse."))
(setq wd (getdist "\nEnter the width or length of the ellipse."))
)
(progn
(setq len (* 2 (/ (/ area pi) (/ wd 2.0))))
(prompt (strcat "\nThe size of the ellipse needed is "
(rtos wd 2)
" by "
(rtos len 2)
)
)
)
)
(princ)
)
(prompt "\nAVCAD Ellipse routine loaded, Enter AVEllipse to run.")
(princ)
-
Hi Avcad,test my code maybe suit for you
(defun c:eba (/ opt loc a pia b are crat p1 p2 bx ax arex piax arex1 px1 px2)
(prompt "Select horizontal or vertical")
(initget "h v")
(setq opt (getkword "\nDo you want Ellipse position [h/v]<h>; "))
(if (= opt nil)(setq opt "h"))
(setq loc (getpoint "\nClick location for object <0,0,0>: "))
(if (= loc nil)(setq loc '(0 0 0)))
(setq a (getdist "\nEnter length of major axis <1.35100001>: "))
(if (= a nil)(setq a 1.35100001))
(setq ae (getreal "\nEnter new area of ellipse <5.16>: "))
(if (= ae nil)(setq ae 5.16))
(if
(= a 1.35100001)
(progn ; if length of major axis is default
(setq pia (* pi a))
(setq b (/ ae pia))
(setq are (* pi a b))
(setq crat (abs (/ (- (/ (* (- a b) 100.0) a) 100.0) 100.0)))
(setq rat
(getreal
(strcat "\nEnter new ratio major and minor <" (rtos crat) ">: ")))
(if (= rat nil)(setq rat crat))
(if
(= rat crat)
(progn
(if
(= opt "h")
(progn
(setq p1 (polar loc 0 a))
(setq p2 (polar loc (* pi 0.5) b))
(command "_ellipse" "c" loc p1 p2 "")
) ; progn
(progn
(setq p1 (polar loc (* pi 0.5) a))
(setq p2 (polar loc 0 b))
(command "_ellipse" "c" loc p1 p2 "")
) ; progn
) ; if
) ; progn
(progn
(if
(= opt "v")
(progn
(setq bx (* a rat))
(setq ax (/ bx rat))
(setq arex (* pi ax bx))
(if
(/= ae arex)
(progn
(setq piax (* pi ax))
(setq bx (/ ae piax))
(setq arex1 (* pi ax bx))
(if
(= ae arex1)
(progn
(setq px1 (polar loc 0 ax))
(setq px2 (polar loc (* pi 0.5) bx))
(command "_ellipse" "c" loc px1 px2 "")
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
(if
(= opt "v")
(progn
(setq bx (* a rat))
(setq ax (/ bx rat))
(setq arex (* pi ax bx))
(if
(/= ae arex)
(progn
(setq piax (* pi ax))
(setq bx (/ ae piax))
(setq arex1 (* pi ax bx))
(if
(= ae arex1)
(progn
(setq px1 (polar loc (* pi 0.5) ax))
(setq px2 (polar loc 0 bx))
(command "_ellipse" "c" loc px1 px2 "")
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
) ; progn
(progn ; if length of major axis not default
(setq pia (* pi a))
(setq b (/ ae pia))
(setq are (* pi a b))
(setq crat (abs (/ (- (/ (* (- a b) 100.0) a) 100.0) 100.0)))
(setq rat
(getreal
(strcat "\nEnter new ratio major and minor <" (rtos crat) ">: ")))
(if (= rat nil)(setq rat crat))
(if
(= rat crat)
(progn
(setq p1 (polar loc 0 a))
(setq p2 (polar loc (* pi 0.5) b))
(command "_ellipse" "c" loc p1 p2 "")
) ; progn
(progn
(if
(= opt "h")
(progn
(setq bx (* a rat))
(setq ax (/ bx rat))
(setq arex (* pi ax bx))
(if
(/= ae arex)
(progn
(setq piax (* pi ax))
(setq bx (/ ae piax))
(setq arex1 (* pi ax bx))
(if
(= ae arex1)
(progn
(setq px1 (polar loc 0 ax))
(setq px2 (polar loc (* pi 0.5) bx))
(command "_ellipse" "c" loc px1 px2 "")
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
(if
(= opt "v")
(progn
(setq bx (* a rat))
(setq ax (/ bx rat))
(setq arex (* pi ax bx))
(if
(/= ae arex)
(progn
(setq piax (* pi ax))
(setq bx (/ 5.16 piax))
(setq arex1 (* pi ax bx))
(if
(= ae arex1)
(progn
(setq px1 (polar loc (* pi 0.5) ax))
(setq px2 (polar loc 0 bx))
(command "_ellipse" "c" loc px1 px2 "")
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
) ; progn
) ; if
(command "_zoom" "e")
(princ)
)