# AnalyticGeometry

Analytic 2-D geometry description

## Description

`AnalyticGeometry` describes a 2-D geometry in the form of an analytic geometry object. `PDEModel`, `StructuralModel`, and `ThermalModel` objects have a `Geometry` property, which can be an `AnalyticGeometry` or `DiscreteGeometry` object.

## Creation

Add a 2-D analytic geometry to your model by using `decsg` to create the geometry and `geometryFromEdges` to attach it to the model.

## Properties

expand all

Number of geometry edges, specified as a positive integer.

Data Types: `double`

Number of geometry faces, specified as a positive integer. If your geometry is one connected region, then `NumFaces = 1`.

Data Types: `double`

Number of geometry vertices, specified as a positive integer.

Data Types: `double`

Coordinates of geometry vertices, specified as an `N`-by-2 numeric matrix where `N` is the number of vertices.

Data Types: `double`

## Object Functions

 `faceEdges` Find edges belonging to specified faces `facesAttachedToEdges` Find faces attached to specified edges `nearestEdge` Find edges nearest to specified point `nearestFace` Find faces nearest to specified point

## Examples

collapse all

Create a decomposed solid geometry model representing a rectangle and include it in a PDE model.

Create a default scalar PDE model.

`model = createpde;`

Define a geometry representing a rectangle.

`R1 = [3,4,-1,1,1,-1,0.5,0.5,-0.75,-0.75]';`

Decompose the geometry into minimal regions.

`g = decsg(R1);`

Create the geometry from the decomposed geometry matrix.

`geometryFromEdges(model,g);`

Plot the geometry.

```pdegplot(model,EdgeLabels="on") axis equal xlim([-1.1,1.1]) ylim([-0.9,0.6])```

## Version History

Introduced in R2015a