Skip to main content
Became Hot Network Question
edited tags
Link
azerbajdzan
  • 25.1k
  • 2
  • 22
  • 62
added 231 characters in body
Source Link
qwerty
  • 1.4k
  • 1
  • 8
  • 10

I observed a strange behavior using Polygon with Graphics3D in MMA14.1.

Here is my example.

    polygon = {{-0.4, 1.7, 0.}, {-0.8, 1.7, 0.}, {-1.2, 1.8, 0.}, {-1.4, 
    1.9, 0.}, {-1.5, 2., 0.}, {-1.5, -0.5, 0.}, {1, -0.5, 0.}, {1, 
    1.8, 0.}};
    hole = {{0., 0., 0}, {0.5, 0., 0.}, {0.5, 0.5, 0.}, {0., 0.5, 0.}};
    Graphics3D[Polygon[polygon -> hole], Axes -> True]

Its result is an unfilled 3D polygon on the XY-plane.

enter image description here

However, by slightly changing the first coordinate, for example ( {-0.4, 1.7, 0.} -> {-0.4, 1.8, 0.} ), it works as expected.

enter image description here

Could someone please explain this situation?

According to the suggestion from user64494

Graphics3D[
 Polygon[Join @@ (Append[#, #[[1]]] & /@ {polygon, Reverse[hole]})]]

enter image description here

I observed a strange behavior using Polygon with Graphics3D in MMA14.1.

Here is my example.

    polygon = {{-0.4, 1.7, 0.}, {-0.8, 1.7, 0.}, {-1.2, 1.8, 0.}, {-1.4, 
    1.9, 0.}, {-1.5, 2., 0.}, {-1.5, -0.5, 0.}, {1, -0.5, 0.}, {1, 
    1.8, 0.}};
    hole = {{0., 0., 0}, {0.5, 0., 0.}, {0.5, 0.5, 0.}, {0., 0.5, 0.}};
    Graphics3D[Polygon[polygon -> hole], Axes -> True]

Its result is an unfilled 3D polygon on the XY-plane.

enter image description here

However, by slightly changing the first coordinate, for example ( {-0.4, 1.7, 0.} -> {-0.4, 1.8, 0.} ), it works as expected.

enter image description here

Could someone please explain this situation?

I observed a strange behavior using Polygon with Graphics3D in MMA14.1.

Here is my example.

    polygon = {{-0.4, 1.7, 0.}, {-0.8, 1.7, 0.}, {-1.2, 1.8, 0.}, {-1.4, 
    1.9, 0.}, {-1.5, 2., 0.}, {-1.5, -0.5, 0.}, {1, -0.5, 0.}, {1, 
    1.8, 0.}};
    hole = {{0., 0., 0}, {0.5, 0., 0.}, {0.5, 0.5, 0.}, {0., 0.5, 0.}};
    Graphics3D[Polygon[polygon -> hole], Axes -> True]

Its result is an unfilled 3D polygon on the XY-plane.

enter image description here

However, by slightly changing the first coordinate, for example ( {-0.4, 1.7, 0.} -> {-0.4, 1.8, 0.} ), it works as expected.

enter image description here

Could someone please explain this situation?

According to the suggestion from user64494

Graphics3D[
 Polygon[Join @@ (Append[#, #[[1]]] & /@ {polygon, Reverse[hole]})]]

enter image description here

edited tags
Link
user64494
  • 29.1k
  • 4
  • 29
  • 56
Source Link
qwerty
  • 1.4k
  • 1
  • 8
  • 10
Loading