Message Boards Message Boards

0
|
12286 Views
|
9 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Help exporting to Autocad.

Posted 9 years ago

Hello,

I will wave the novice flag first and admit I am new to the use of Mathematica. I have the code of a shape I want to export as a *.dxf file , but after seeing some youtube tutorials and seeing some threads over here, i haven't managed to get it right.

Manipulate[
 Show[calabi[0, 0, 0, alpha, 0, clr], ViewPoint -> {-1.4, 0, 1.4}, 
  Lighting -> 
   If[clr, {{"Ambient", GrayLevel[.5]}, {"Directional", White, 
      ImageScaled@{0, 0, 2}}}, {{"Ambient", 
      GrayLevel[.25]}, {"Directional", RGBColor[0.5, .5, 1], 
      ImageScaled@{0, 1, 0}}, 
          {"Directional", RGBColor[1, 0.5, 0.5], 
      ImageScaled@{1, -1, 0}}, {"Directional", RGBColor[0.5, 1, .5], 
      ImageScaled@{-1, -1, 0}}}], PlotRange -> 1.2, Boxed -> False, 
  Axes -> False, SphericalRegion -> True, ImageSize -> {450, 450}, 
  ViewAngle -> \[Pi]/4.5],
 {{alpha, \[Pi]/4, "projection angle"}, 0, 2 Pi},
 {{clr, False, "color code surface"}, {True, False}},
 Initialization :> {
   u1[a_, b_] := .5 (E^(a + I*b) + E^(-a - I*b));
   u2[a_, b_] := .5 (E^(a + I*b) - E^(-a - I*b));
   z1k[a_, b_, n_, k_] := E^(k*2*Pi*I/n)*u1[a, b]^(2.0/n);
   z2k[a_, b_, n_, k_] := E^(k*2*Pi*I/n)*u2[a, b]^(2.0/n);
   n = 5;
   calabi[x_, y_, z_, \[Alpha]_, t_, c_] := 
    Table[
     With[{alpha = \[Alpha] - t}, 
      ParametricPlot3D[
       Evaluate@{Re[z1k[a, b, n, k1]] + x, Re[z2k[a, b, n, k2]] + y, 
         Cos[alpha]*Im[z1k[a, b, n, k1]] + 
          Sin[alpha]*Im[z2k[a, b, n, k2]] + z}, {a, -1, 1}, {b, 
        0, \[Pi]/2}, Boxed -> False, Axes -> False, PlotPoints -> 15, 
       PlotStyle -> 
        If[c, RGBColor@{If[k1 == 0 && k2 == 0, 0, 
            Rescale[k1, {0, n - 1}]], 
           If[k1 == 0 && k2 == 0, 0, Rescale[k2, {0, n - 1}]], 
           If[k1 == 0 && k2 == 0, 1, 0]}, {RGBColor[.5, .5, 1], 
          Specularity[White, 128]}], MaxRecursion -> 0, 
       PerformanceGoal -> "Speed", Mesh -> None]], {k1, 0, 
      n - 1}, {k2, 0, n - 1}];
   }, SynchronousInitialization -> False]

A screencap of the desired figure

I understand how ungrateful it is to use a first post asking for help but I've hit a dead end with this. Any help would be much appreciated.

Best, Carlos

POSTED BY: Carlos Ortega
9 Replies

shameless bump

POSTED BY: Carlos Ortega
POSTED BY: Sean Clarke

Thanks Sean.

i'm sorry, but nothing happens when i hit Enter after the closing the bracket...

stl works fine, since i just want to manipulate the variety in a CAD program.

POSTED BY: Carlos Ortega

Can you get Mathematica to evaluate "2+2"?

It should of course respond with "4"

POSTED BY: Sean Clarke

apparently not. nothing happens after the enter.

POSTED BY: Carlos Ortega

Please first go through some introductory material or a video on Mathematica:

https://www.youtube.com/watch?v=CPAvRsQXK8c

It's important to understand some of the basics before trying any of this.

Evaluating a command in Mathematica requires that you use both Shift and Enter together.

POSTED BY: Sean Clarke

boy. i haven't feel this newbie in some time. thanks for the patience. What i really want to do is to see of there's a way to make the figure more graphically comprehensible, if you can think of a way of how i could accentuate the curves , i'd be extremely grateful.

POSTED BY: Carlos Ortega

to make it look something like thisenter image description here

POSTED BY: Carlos Ortega

i've been playing around with the figure's code now that i know how to Evaluate...

POSTED BY: Carlos Ortega
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract