Message Boards Message Boards

0
|
4483 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How to enrich a region with extra drawing primitives?

Posted 10 years ago
POSTED BY: Thomas Vogler
2 Replies

* Face palm *

Facepalm from Wikipedia

Show[DiscretizeRegion[area], Graphics[stuff]]

does what i want. But i don't understand why and how this works. Any pointers are welcome.

POSTED BY: Thomas Vogler

I learned something new....

MeshReigons are new objects in Mathematica 10. E.g., from your example, the Head of DiscretizeRegion

 DiscretizeRegion[area] // Head

is

MeshRegion 

So it is not a Graphics though its OutputForm is to display it graphically, which makes good sense. To get the graphics primitives from a MeshReigon in order to use them in a Graphics directly you can use MeshPrimitives to extract them from the MeshReigon itself as in

Graphics[{stuff, EdgeForm[{Thick, Green}], 
  MeshPrimitives[DiscretizeRegion[area], 1], FaceForm[LightPurple], 
  MeshPrimitives[DiscretizeRegion[area], 2]}]
POSTED BY: David Reiss
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