Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to make a Polygon with straight border lines. For that purpose I wrote the following code, but it doesn't show straight borders.

Graphics3D[{Style[Polygon[{{20, 0, 10}, {50, 0, 10}, {50, 0, 25}, {20, 0, 25}}],
  Lighting -> {{"Ambient", LightBlue}}]}, Boxed -> False, RotationAction -> "Clip"]

How can I make a polygon with straight lines?

enter image description here

share|improve this question
    
Related: mathematica.stackexchange.com/q/198/131 –  Yves Klett Feb 26 '13 at 10:23
    
You can switch the antialiasing quality of Preferences->Appearance->Graphics to Highest but beware as it might make graphics display unresponsive for higher resolution graphics. –  gpap Feb 26 '13 at 10:23

2 Answers 2

The Antialiasing quality dialog in Preferences offers an adjustable setting (if you have appropriate hadware, see here):

anti aliasing dialog

You can compare the differences between the two extremes in the following screen shots:

Graphics3D[
 Polygon[{{20, 0, 10}, {50, 0, 10}, {50, 0, 25}, {20, 0, 25}}], 
 Lighting -> {{"Ambient", LightBlue}},
 Boxed -> False,
 RotationAction -> "Clip"]

No Antialiasing:

enter image description here

Highest quality: enter image description here

They're not as different as you might expect. The results are probably very hardware and operating-system specific.

share|improve this answer

From a related Q/A Antialiasing of horizontal lines:

 Row[Graphics3D[{Antialiasing -> #,
 Polygon[{{20, 0, 10}, {50, 0, 10}, {50, 0, 25}, {20, 0, 25}}]},
 Lighting -> {{"Ambient", LightBlue}}, Boxed -> False,
 RotationAction -> "Clip", ImageSize -> 400] & /@ {True, False}]

enter image description here

share|improve this answer
    
thanks for answering,still side boarders are not straight lines –  subbu Feb 26 '13 at 11:10
    
@subbu Why do you say they're not straight? –  cormullion Feb 26 '13 at 11:59
    
@cormullion not straight line in the seance,that boarder lines are not smooth. –  subbu Feb 26 '13 at 12:08
2  
@subbu Does this demo explain why they're not smooth? –  cormullion Feb 26 '13 at 12:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.