BoundaryDiscretizeGraphics

BoundaryDiscretizeGraphics[g]

discretizes a 2D or 3D graphic g into a BoundaryMeshRegion.

BoundaryDiscretizeGraphics[g,patt]

discretizes only the elements in g that match the pattern patt.

Details and Options

Examples

open allclose all

Basic Examples  (3)

Discretize a 2D special region including Disk:

Parallelogram:

Discretize 3D special regions including Cone:

Prism:

Discretize a whole 2D Graphics scene, where multiple primitives are taken as a union:

Scope  (15)

Graphics  (9)

Discretize a 2D special region including Disk:

Parallelogram:

Discretize Graphics with GraphicsComplex containing Line and Polygon:

Discretize Graphics with GraphicsComplex containing Rectangle and Disk:

Discretize a whole 2D Graphics scene, where multiple primitives are taken as a union:

Discretize only those primitives that match a pattern:

Discretize primitives with area < 1:

Discretize All primitives:

Bounded piecewise linear Graphics primitives can be represented exactly:

Unbounded piecewise linear Graphics primitives can only be represented within a finite range:

Nonlinear Graphics primitives can only be approximately represented:

Use MaxCellMeasure to control the level of discretization:

Graphics3D  (6)

Discretize 3D special regions including Cone:

Prism:

3D styling primitives are discarded:

Discretize Graphics3D with GraphicsComplex of Polyhedron:

Bounded piecewise linear Graphics3D primitives can be represented exactly:

Nonlinear Graphics3D primitives can only be approximately represented:

Use MaxCellMeasure to control the level of discretization:

Options  (23)

MaxCellMeasure  (6)

Discretize with a maximum cell area of 0.1:

Discretize with a maximum edge length of 0.5:

This gives the lengths of the sides:

Discretize with a maximum cell volume of 0.05:

Discretize with a maximum face area of 0.1:

A Histogram of the face areas:

Compare different length settings:

Compare different face area settings:

MeshCellHighlight  (2)

MeshCellHighlight allows you to specify highlighting for parts of a BoundaryMeshRegion:

Individual cells can be highlighted using their cell index:

Or by the cell itself:

MeshCellLabel  (3)

MeshCellLabel can be used to label parts of a BoundaryMeshRegion:

Label the vertices and edges of a rectangle:

Individual cells can be labeled using their cell index:

Or by the cell itself:

MeshCellMarker  (1)

MeshCellMarker can be used to assign values to parts of a BoundaryMeshRegion:

Use MeshCellLabel to show the markers:

MeshCellShapeFunction  (2)

MeshCellShapeFunction allows you to specify functions for parts of a BoundaryMeshRegion:

Individual cells can be drawn using their cell index:

Or by the cell itself:

MeshCellStyle  (2)

MeshCellStyle allows you to specify styling for parts of a BoundaryMeshRegion:

Individual cells can be highlighted using their cell index:

Or by the cell itself:

PlotRange  (5)

Automatic includes the entire range of a finite region:

Automatic includes a partial range of an infinite region:

Explicit settings are respected:

Unless overridden:

Focus region of interest:

Clipping a solid primitive results in a solid primitive:

Compare different settings:

PlotTheme  (2)

Use a theme with grid lines and a legend:

Use a theme to draw a wireframe:

Applications  (3)

Compute the volume of a graphic by converting it to a geometric region:

Convert Text to a geometric region:

Convert a country polygon to a geometric region:

Properties & Relations  (9)

Multiple primitives are interpreted as a union:

Bounded linear primitives can be exactly discretized:

Unbounded linear primitives can only be represented within a finite range:

Nonlinear primitives can only be approximately discretized:

Use DiscretizeGraphics to get a MeshRegion representation:

BoundaryDiscretizeRegion can be used to discretize any RegionQ object:

BoundaryDiscretizeGraphics can be used to discretize Graphics and Graphics3D objects:

They can both discretize special regions that are also graphics primitives:

Graphics primitives that are also geometric regions can be used without discretization:

Compute directly with the region:

Or with its discretized version:

Rasterize discretizes any rendered expression to Graphics containing a Raster object:

Image discretizes any rendered expression to an Image object:

Possible Issues  (1)

Primitives with Offset coordinates are not discretized:

Wolfram Research (2014), BoundaryDiscretizeGraphics, Wolfram Language function, https://reference.wolfram.com/language/ref/BoundaryDiscretizeGraphics.html (updated 2015).

Text

Wolfram Research (2014), BoundaryDiscretizeGraphics, Wolfram Language function, https://reference.wolfram.com/language/ref/BoundaryDiscretizeGraphics.html (updated 2015).

CMS

Wolfram Language. 2014. "BoundaryDiscretizeGraphics." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/BoundaryDiscretizeGraphics.html.

APA

Wolfram Language. (2014). BoundaryDiscretizeGraphics. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BoundaryDiscretizeGraphics.html

BibTeX

@misc{reference.wolfram_2024_boundarydiscretizegraphics, author="Wolfram Research", title="{BoundaryDiscretizeGraphics}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/BoundaryDiscretizeGraphics.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_boundarydiscretizegraphics, organization={Wolfram Research}, title={BoundaryDiscretizeGraphics}, year={2015}, url={https://reference.wolfram.com/language/ref/BoundaryDiscretizeGraphics.html}, note=[Accessed: 21-November-2024 ]}