WOLFRAM

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

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

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Discretize a 2D special region including Circle:

Out[1]=1

Parallelogram:

Out[2]=2

Discretize 3D special regions including Cone:

Out[1]=1

Prism:

Out[2]=2

Scope  (17)Survey of the scope of standard use cases

Graphics  (9)

Discretize a 2D special region including Circle:

Out[1]=1

Parallelogram:

Out[2]=2

Discretize Graphics with GraphicsComplex containing Point, Line, and Polygon:

Out[2]=2
Out[3]=3

Discretize Graphics with GraphicsComplex containing Rectangle, Circle, and Disk:

Out[2]=2
Out[3]=3

Discretize only those primitives that match a pattern:

Out[1]=1
Out[2]=2

Discretize primitives with dimension less than 2:

Out[3]=3

Discretize All primitives:

Out[4]=4

Bounded piecewise linear Graphics primitives can be represented exactly:

Out[1]=1
Out[2]=2

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

Out[2]=2
Out[3]=3

Nonlinear Graphics primitives can only be approximately represented:

Out[1]=1
Out[2]=2

Graphics involving GraphicsComplex:

Out[2]=2
Out[3]=3

Use MaxCellMeasure to control the level of discretization:

Out[1]=1
Out[2]=2

Graphics3D  (8)

Discretize 3D special regions including Cone:

Out[1]=1

Prism:

Out[2]=2

Discretize Graphics3D with GraphicsComplex containing Point, Line, and Polygon:

Out[2]=2
Out[3]=3

Discretize a whole Graphics3D scene, where multiple primitives are taken as a union:

Out[1]=1
Out[2]=2

Discretize only those primitives that match a pattern:

Out[2]=2
Out[3]=3

Discretize primitives with dimension less than 2:

Out[4]=4

Discretize All primitives:

Out[5]=5

Bounded piecewise linear Graphics3D primitives can be represented exactly:

Out[2]=2
Out[3]=3

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

Out[2]=2
Out[3]=3

Nonlinear Graphics3D primitives can only be approximately represented:

Out[1]=1
Out[2]=2

Use MaxCellMeasure to control the level of discretization:

Out[1]=1
Out[2]=2

Options  (23)Common values & functionality for each option

MaxCellMeasure  (6)

Discretize with a maximum cell area of 0.1:

Out[1]=1

This gives the area of the cells:

Out[2]=2

Discretize with a maximum cell volume of 0.1:

Out[1]=1
Out[2]=2

A Histogram of the cell volumes:

Out[3]=3

Compare different length settings:

Out[1]=1
Out[2]=2

Compare different area settings:

Out[1]=1
Out[2]=2

Compare different face area settings:

Out[1]=1
Out[2]=2

Compare different volume settings:

Out[1]=1
Out[2]=2

MeshCellHighlight  (2)

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

Out[1]=1

Individual cells can be highlighted using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellLabel  (3)

MeshCellLabel can be used to label parts of a MeshRegion:

Out[1]=1

Label the vertices and edges of a parallelogram:

Out[1]=1

Individual cells can be labeled using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellMarker  (1)

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

Out[1]=1

Use MeshCellLabel to show the markers:

Out[2]=2

MeshCellShapeFunction  (2)

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

Out[1]=1

Individual cells can be drawn using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellStyle  (2)

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

Out[1]=1

Individual cells can be highlighted using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

PlotRange  (5)

Automatic includes the entire range of a finite region:

Out[4]=4

Automatic includes a partial range of an infinite region:

Out[9]=9

Explicit settings are respected:

Out[1]=1
Out[2]=2

Unless overridden:

Out[3]=3

Focus region of interest:

Out[2]=2

Clipping a solid primitive results in a solid primitive; otherwise, interiors are exposed:

Out[1]=1
Out[2]=2

Compare different settings:

Out[2]=2

PlotTheme  (2)

Use a theme with grid lines and a legend:

Out[2]=2

Use a theme to draw a wireframe:

Out[1]=1

Applications  (4)Sample problems that can be solved with this function

Compute the length of a curve by converting it to a geometric region:

Out[2]=2
Out[3]=3

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

Out[2]=2
Out[3]=3

Convert Text to a geometric region:

Out[1]=1
Out[2]=2

Convert a country polygon to a geometric region:

Out[1]=1

Properties & Relations  (9)Properties of the function, and connections to other functions

Multiple primitives are interpreted as a union:

Out[1]=1
Out[2]=2

Bounded linear primitives can be exactly discretized:

Out[1]=1
Out[2]=2

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

Out[1]=1
Out[2]=2

Nonlinear primitives can only be approximately discretized:

Out[1]=1
Out[2]=2

Use BoundaryDiscretizeGraphics to get a BoundaryMeshRegion representation:

Out[1]=1
Out[2]=2
Out[3]=3

DiscretizeRegion can be used to discretize any RegionQ object:

Out[1]=1

DiscretizeGraphics can be used to discretize Graphics and Graphics3D objects:

Out[2]=2

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

Out[3]=3

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

Out[2]=2

Compute directly with the region:

Out[3]=3

Or with its discretized version:

Out[4]=4

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

Out[1]=1
Out[2]=2

Image discretizes any rendered expression to an Image object:

Out[1]=1
Out[2]=2

Possible Issues  (4)Common pitfalls and unexpected behavior

Primitives with Scaled coordinates are not discretized:

Out[1]=1
Out[2]=2

Primitives with Offset coordinates are not discretized:

Out[1]=1
Out[2]=2

Primitives with ImageScaled coordinates are not discretized:

Out[1]=1
Out[2]=2

DiscretizeGraphics for Graphics3D with multiple volume primitives is not supported:

Out[1]=1
Out[2]=2
Wolfram Research (2014), DiscretizeGraphics, Wolfram Language function, https://reference.wolfram.com/language/ref/DiscretizeGraphics.html (updated 2015).
Wolfram Research (2014), DiscretizeGraphics, Wolfram Language function, https://reference.wolfram.com/language/ref/DiscretizeGraphics.html (updated 2015).

Text

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

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

CMS

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

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

APA

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

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

BibTeX

@misc{reference.wolfram_2025_discretizegraphics, author="Wolfram Research", title="{DiscretizeGraphics}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/DiscretizeGraphics.html}", note=[Accessed: 27-March-2025 ]}

@misc{reference.wolfram_2025_discretizegraphics, author="Wolfram Research", title="{DiscretizeGraphics}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/DiscretizeGraphics.html}", note=[Accessed: 27-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_discretizegraphics, organization={Wolfram Research}, title={DiscretizeGraphics}, year={2015}, url={https://reference.wolfram.com/language/ref/DiscretizeGraphics.html}, note=[Accessed: 27-March-2025 ]}

@online{reference.wolfram_2025_discretizegraphics, organization={Wolfram Research}, title={DiscretizeGraphics}, year={2015}, url={https://reference.wolfram.com/language/ref/DiscretizeGraphics.html}, note=[Accessed: 27-March-2025 ]}