Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

# Geometry

Define geometry

Include a 2-D or 3-D geometry into your model by using one of these approaches:

• Import an STL file into MATLAB®by using `importGeometry`. The STL file format is very common and supported by most CAD software. In case of a planar STL geometry, the toolbox converts it to a 2-D geometry by mapping it to the X-Y plane.

• Reconstruct a geometry from a mesh by using `geometryFromMesh`. This function works with triangulated meshes, including planar, volume, and surface triangulation that bounds a closed volume.

For 3-D problems, you can create a geometry by stacking or nesting cubes, cylinders, or spheres.

For 2-D problems, you can create a geometry via the constructive solid geometry (CSG), by writing a geometry function, or by using the `polyshape` function. The CSG approach uses a set of solid building blocks (square, rectangle, circle, ellipse, and polygon) and combines them to define complex geometries. Alternatively, you can create a 2-D geometry in the PDE Modeler app. The app uses the CSG approach.

## Functions

expand all

 `geometryFromMesh` Create geometry from mesh `importGeometry` Import geometry from STL data `pdegplot` Plot PDE geometry
 `geometryFromEdges` Create 2-D geometry `decsg` Decompose constructive solid geometry into minimal regions `csgchk` Check validity of Geometry Description matrix `csgdel` Delete borders between minimal regions `pdearcl` Interpolation between parametric representation and arc length `wgeom` Write geometry specification function `pdecirc` Draw circle in PDE Modeler app `pdeellip` Draw ellipse in PDE Modeler app `pdepoly` Draw polygon in PDE Modeler app `pderect` Draw rectangle in PDE Modeler app
 `multicuboid` Create geometry formed by several cubic cells `multicylinder` Create geometry formed by several cylindrical cells `multisphere` Create geometry formed by several spherical cells

## Apps

 PDE Modeler Solve partial differential equations in 2-D regions

## Properties

 AnalyticGeometry Properties 2-D geometry description DiscreteGeometry Properties 3-D geometry description

## Topics

### 2-D and 3-D Geometry

STL File Import

Include a geometry into your PDE model by importing an STL file.

Geometry from Triangulated Mesh

Reconstruct a geometry from a tetrahedral mesh and from a planar multidomain mesh.

Geometry from polyshape

Reconstruct a geometry from a triangulated mesh created by the MATLAB `polyshape` function.

Geometry from alphaShape

Reconstruct a geometry from a triangulated surface mesh created by the MATLAB `alphaShape` function.

### 2-D Geometry Only

Three Ways to Create 2-D Geometry

Choose an approach for creating a 2-D geometry.

2-D Geometry Creation in PDE Modeler App

Draw, rotate, and combine basic shapes in the PDE Modeler app.

2-D Geometry Creation at Command Line

Use constructive solid geometry (CSG) modeling approach to combine basic shapes at the command line.

Parametrized Function for 2-D Geometry Creation

Create a 2-D geometry by using a parametrized function.

### 3-D Geometry Only

Cuboids, Cylinders, and Spheres

Create a 3-D geometry by stacking or nesting three basic volumes.

Get trial now