Main Content

shape.Polygon

Create polygon on xy-plane

Since R2023b

    Description

    The shape.Polygon lets you create a polygon with metal material properties on the xy-plane, centered at the origin. Use this polygon along with the other shapes and the geometric operations to create a shape for the custom antenna.

    Creation

    Description

    poly = shape.Polygon creates a polygon shape on the xy-plane.

    poly = shape.Polygon(Name=Value) sets additional Properties using one or more name-value arguments. Name is the property name and Value is the corresponding value. You can specify several name-value arguments in any order as Name1=Value1, ..., NameN=ValueN. Properties that you do not specify retain their default values.

    example

    Properties

    expand all

    Name of the polygon, specified as a string.

    Example: "Polygon1"

    Data Types: string

    Cartesian coordinates of the polygon vertices, specified as a N-by-3 matrix in meters, where N is the number of points.

    Example: [-1 0 0; -0.5 0.2 0; 0 0 0]

    Data Types: double

    Metal material of the shape, specified as a metal name string from the Metal Catalog.

    Example: "Copper"

    Data Types: string

    Color of shape, specified as either a character for color short name or a three-element real vector of RGB triplets. The default shape color is yellow. See the Types of Color Values supported by this property. When you unite two shapes of different colors, use "Individual" value to retain the colors of the original shapes in the resultant shape.

    Example: "r"

    Example: [0 0.447 0.741]

    Data Types: double | string | char

    Transparency of shape, specified as a scalar in the (0,1) range, where 0 corresponds to full transparency while 1 corresponds to full opaqueness.

    Example: 0.75

    Data Types: double

    Color of shape edges, specified as either a character for color short name or a three-element real vector of RGB triplets. The default edge color is black. See the Types of Color Values supported by this property. When you unite two shapes of different edge colors, use "Individual" value to retain the edge colors of the original shapes in the resultant shape.

    Example: "b"

    Example: [0.4940 0.1840 0.5560]

    Data Types: double | string | char

    Object Functions

    addBoolean unite operation on two shapes
    subtractBoolean subtraction operation on two shapes
    intersectIntersection of shape1 and shape2
    plusJoin two shapes
    minusCarve a shape from other shape
    andBoolean intersection operation on two shapes
    areaCalculate area of 2-D shapes in square meters
    showDisplay antenna, array structures, shapes, or platform
    plotPlot boundary of 2-D shape
    meshMesh properties of metal, dielectric antenna, or array structure
    rotateRotate shape about axis by angle
    rotateXRotate shape about x-axis by angle
    rotateYRotate shape about y-axis by angle
    rotateZRotate shape about z-axis by angle
    translateMove shape to new location
    scaleChange size of shape by fixed factor
    imprintShapeImprint 2-D shape on another shape
    createHoleCreate a 2-D hole on custom shape
    extrudeExtrude 2-D shape on another shape
    extrudeLinearLinearly extrude 2-D shape along specified direction
    extrudeRotateExtrude 2-D shape by angle about z-axis
    removeSliversRemove sliver outliers from boundary of shape

    Examples

    collapse all

    Create a polygon with vertices at (-0.2,0,0), (0.4,0,0), and (0,0.5,0). Mesh it with a maximum edge length of 6 cm.

    poly = shape.Polygon('Vertices',[-0.2,0,0;0.4,0,0;0,0.5,0]);
    show(poly)

    Figure contains an axes object. The axes object with xlabel x (mm), ylabel y (mm) contains 2 objects of type patch.

    mesh(poly,MaxEdgeLength=6e-2);

    Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains an object of type patch.

    Add a rectangle and circle to create a polygon shape. Mesh it with a maximum edge length of 6 cm.

    polyS = shape.Rectangle + shape.Circle;
    show(polyS)

    Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains 2 objects of type patch.

    mesh(polyS,MaxEdgeLength=6e-2);

    Figure contains an axes object. The axes object with xlabel x (m), ylabel y (m) contains an object of type patch.

    Version History

    Introduced in R2023b