Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

from a 2d-figure to an interactive 3d model? is it possible with mathematica?

48 views
Skip to first unread message

luke wallace

unread,
Apr 25, 2012, 12:36:25 AM4/25/12
to
http://postimage.org/image/jr35rwdel/

the image above represents spacing rules for engineer stuff. if you
look at it you will see the spacing can be summarized as:

1. 7 foot radius circle drawn around the center point of the
rectangle. This never changes no matter what the dimensions of the
rectangle. So we can ignore this.

2. On the south side of the rectangle, starting at the left and right
corners, a 30 degree line is drawn (making a triangle ABC). Once the
line reaches the 7 foot radius circle, it only goes 13 foot past it
and then curves like a partial circle, keeping 20 feet maximum
distance away from the center of the rectangle at all times. This
changes if the rectangle size is manipulated.

What I need is a way to put this into mathematica or some other
program so I can make it interactive and say, okay my rectangle is 2
foot long and 1 foot wide. Then the drawing would update and show what
it looks like with that size rectangle, and then if someone needed the
rectangle needs to be 3 foot long and 1.5 foot wide, it would auto
update again without having to manually re-calculate by hand each
time?

Tomas Garza

unread,
Apr 26, 2012, 5:32:19 AM4/26/12
to
If I understood correctly, the following piece of code would be the starting point. You'd just have to complete the symmetric triangle and fill in details like Text and nice embellishments.
Manipulate[Graphics[{Circle[{0,0},7],Line[{{h,-d},{h,-d},{h,d},{-h,d},{-h,-d},{h,-d}}],Line[{{h,-d},{h,-20},{20 Sin[30 Degree]-h,-20},{h,-d}}],Circle[{0,0},20]},PlotRange->{{-12,12},{-25,7.5}}],{{d,1},0.5,4},{{h,2},0.5,4}]

-Tomas

> Date: Wed, 25 Apr 2012 00:34:09 -0400
> From: lukewal...@gmail.com
> Subject: from a 2d-figure to an interactive 3d model? is it possible with mathematica?
> To: math...@smc.vnet.net

Bob Hanlon

unread,
Apr 26, 2012, 5:33:50 AM4/26/12
to
Use Manipulate. Here is a partial example :

Manipulate[
Module[
{tan, ll, lr, ur, r, pt, t},
tan = Tan[30 Degree];
ll = {-w/2, -d/2};
lr = {w/2, -d/2};
ur = {w/2, d/2};
r = Sqrt[(20 + d/2)^2 + (w/2)^2];
pt = {x, y} /. FindRoot[
{tan == (x - w/2)/(y - d/2),
x^2 + y^2 == r^2}, {x, 12}, {y, 20}];
t = ArcTan @@ Reverse[pt];
Graphics[
{Thin, Circle[{0, 0}, 7],
Line[{{-7, -4}, {-7, 4}}],
Circle[{0, 0}, r, -90 Degree + {-t, t}],
{AbsoluteDashing[{6, 6, 72, 6}],
Line[{{0, 9}, {0, -22 - d/2}}]},
{White, EdgeForm[Thick],
Rectangle[ll, ur]},
{AbsoluteDashing[{8, 4}],
Table[Line[lr + # & /@
{{0, 0}, {0, -x}, {x*tan, -x}, {0, 0}}],
{x, 10, 20, 5}],
Line[{ll, -pt}]},
Text["High- \ntemperature zone",
{-4.5, 4}, {-1, 0}],
Text["B=0.5774*A\nC=1.1547*A", {8, 3.5}, {-1, 0}],
Text["SI units: 1 in = 25.4 mm; 1 ft = 0.31 m",
{-w/2 - 15*tan, -23 - d/2}, {-1, 0}],
Text["B\n5ft 9-5/16in", {w/2 + 5*tan, -10 - d/2}],
Text["B\n8ft 7-7/8in", {w/2 + 7.5*tan, -15 - d/2}],
Text["B\n11ft 6-11/16in", {w/2 + 10*tan, -20 - d/2}],
Text["Intermediate-temperature\nzone",
{-w/4 - 7.5*tan, -r*Cos[t]}],
Text["Airflow", {-5*Tan[t], -9.5 - d/2}],
Arrow[{{-5*Tan[t], -10 - d/2},
{-5*Tan[t], -13 - d/2}}]}]],
{{w, 4., "Rectangle\nWidth (ft)"}, 1, 10, .01,
Appearance -> "Labeled"},
{{d, 2., "Rectangle\nDepth (ft)"}, 1, 10, .01,
Appearance -> "Labeled"}]


Bob Hanlon

luke wallace

unread,
Apr 27, 2012, 6:52:09 AM4/27/12
to
Holy cow. I can't believe that is even possible from just typing code.
It looks like an alien language to me how can I ever hope to know what
I'm doing and write that stuff myself? Are you using some kind of
graphical interface to arrive at that code or something, or are you
just doing math stuff all day?

But please tell me where I can learn to do what you just did, and is
it possible to make the 2D interactive object you guys just made into
a 3D one to also express volume not just area? I mean I know it's
possible theoretically but is it too advanced for an average human
mind to write down in code?

How long did it take you to write that code because to a newbie like
me it looks like it'd take two weeks (it was the first thing I used
mathematica for, took me forever to realize shift+enter makes it
compute then I jumped out of my seat)

Tomas Garza

unread,
Apr 28, 2012, 5:27:42 AM4/28/12
to
Being a member of this group for a number of years has allowed me to watch immature newbies develop into highly competent Mathematica users. I've had the same feeling of awe when I started typing easy things and hitting the shift+enter to obtain amazing results. I now feel that I started learning mathematics after I learned, little by little, how to use Mathematica. I assure you that I possess an average human mind, and I consider myself to be somewhere between the second and the third class in terms of Mathematica skills. My modest advice is: follow this group, where a number of prominent practitioners offer generous assistance to beginners; try to follow their solutions; set yourself problems to develop your skill, and take advantage of the possibility of asking for help whenever you're stuck, however dumb you think your question may be.It takes anywhere from four weeks to six months to start flying on your own. Other places to visit are http://mathematica.stackexchange.com/ and http://demonstrations.wolfram.com/ One other interesting place is http://blog.wolfram.com/ where the Wolfram experts never cease to amaze me.
There must be a few things you can't do with Mathematica, but so far I've not met them.
Good hunting!
-Tomas

> Date: Fri, 27 Apr 2012 06:50:16 -0400
> From: lukewal...@gmail.com
> Subject: Re: from a 2d-figure to an interactive 3d model? is it possible with mathematica?
> To: math...@smc.vnet.net
>

djmpark

unread,
Apr 28, 2012, 5:29:44 AM4/28/12
to
Yes, Mathematica is pretty great and you can do all kinds of wonderful and
useful things with it including learning subject matter and writing powerful
technical documents.

But it takes time to learn it and get good at it. How long did it take you
to learn to write good English, or for any person to express themselves well
in their native language? I seem to recall that the schools spend years and
years on such subjects. How much more difficult is it to learn how to do and
write good mathematics? The idea that one could use Mathematica with
facility "out of the box" is something of a delusion.

This is why those who are aiming for technical careers should be learning
Mathematica as early as possible in secondary school so that when they get
to tackling difficult material they don't have to learn the most basic
things. Unfortunately, very little of this is actually done.

Many students find themselves in the position of having to tackle difficult
course material with Mathematica without knowing Mathematica well enough or
having the time to learn it. That can be very frustrating and not leave a
good first impression of Mathematica.

So if you have a long term interest in mathematical subjects then try to
take time out to learn Mathematica. Work through the tutorials in the
Documentation Center and the Help examples. Try actually typing them in
yourself and making variations. Then try to fly solo by taking SIMPLE
non-Mathematica books and trying to work problems. Try to write tutorials on
various simple topics in which you explain to others how to solve problems
or how some mathematical construction works. It's the best way to learn.
They may even end up being useful to other people.

It really is nice if you can spend the time.


David Park
djm...@comcast.net
http://home.comcast.net/~djmpark/index.html

Bob Hanlon

unread,
Apr 28, 2012, 5:32:17 AM4/28/12
to
Start simple and add one thing at a time evaluating the results at
each step. Refer to the online documentation often until you are much
more experienced--I still use the documentation often.


Bob Hanlon


On Fri, Apr 27, 2012 at 6:50 AM, luke wallace <lukewal...@gmail.com> wrote:
> Holy cow. I can't believe that is even possible from just typing code.
> It looks like an alien language to me how can I ever hope to know what
> I'm doing and write that stuff myself? Are you using some kind of
> graphical interface to arrive at that code or something, or are you
> just doing math stuff all day?
>
> But please tell me where I can learn to do what you just did, and is
> it possible to make the 2D interactive object you guys just made into
> a 3D one to also express volume not just area? I mean I know it's
> possible theoretically but is it too advanced for an average human
> mind to write down in code?
>
> How long did it take you to write that code because to a newbie like
> me it looks like it'd take two weeks (it was the first thing I used
> mathematica for, took me forever to realize shift+enter makes it
> compute then I jumped out of my seat)
>



--
Bob Hanlon

0 new messages