Main Content

shape.Custom3D

Create custom 3-D shape from other shapes or triangulation

Since R2023b

    Description

    The shape.custom3D lets you create a custom shape by using other shapes or triangulation with metal and dielectric material properties. Use this custom shape along with the other shapes and the geometric operations to create a shape for the custom antenna.

    Creation

    Description

    custom3d = shape.Custom3D creates a custom shape.

    example

    custom3d = shape.Custom3D(tr) creates a custom shape using the triangulation data, where tr object is created using the triangulation function.

    example

    custom3d = shape.Custom3D(PropertyName=Value) sets properties using one or more name-value arguments. PropertyName is the property name and Value is the corresponding value. You can specify several name-value arguments in any order as PropertyName1=Value1, ..., PropertyNameN=ValueN. Properties that you do not specify retain their default values.

    For example, custom3d = shape.Custom3D(Name="MyShape",Metal="Copper") creates a 3-D copper shape with default vertices, named "MyShape".

    example

    Properties

    expand all

    Name of the custom shape, specified as a string.

    Example: "CustomShape1"

    Data Types: string

    Cartesian coordinates of the shape 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. To use the shape as a pure metal, set the Dielectric property to "Air". To create a metal-dielectric shape, use the addSubstrate function.

    Example: "Copper"

    Data Types: string

    Dielectric material of the shape, specified as a dielectric name string from the Dielectric Catalog. To use the shape as a pure dielectric, set this property's value to a material other than "Air". In this scenario, value specified in the Metal property is ignored. To create a metal-dielectric shape, use the addSubstrate function.

    Example: "Teflon"

    Data Types: string

    Frequency dispersion model for dielectric material, specified as a string. The default frequency model is Constant. Other supported frequency models are as below:

    • Frequency independent: Constant

    • Frequency dependent: DjordjevicSarkar and MeanDjordjevicSarkar

    The DjordjevicSarkar model uses extrapolation techniques to predict properties of dielectric materials over a wide frequency range from a single frequency point measurement. The MeanDjordjevicSarkar model uses average value of the DjordjevicSarkar model over a frequency range of interest to predict properties of dielectric materials. Use the frequency independent model for narrow band applications. Use the frequency dependent models for wideband applications.

    Example: "DjordjevicSarkar"

    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

    expand all

    addPerform Boolean unite operation on two shapes
    andPerform Boolean intersection operation on two shapes
    intersectGenerate and plot intersection of two shapes
    minusCarve a shape from other shape
    plusJoin two shapes
    subtractPerform Boolean subtraction operation on two shapes
    addSubstrateCreate metal-dielectric shape
    createHoleCreate a 2-D hole on custom shape
    extrudeExtrude 2-D shape on another shape
    imprintShapeImprint 2-D shape on another shape
    removeFacesInteractively select and remove 3-D shape faces
    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
    scaleChange size of shape by fixed factor
    translateMove shape to new location
    getShapeVerticesFind shape vertices
    meshGenerate and view mesh for antennas, arrays, and custom shapes
    showDisplay antenna, array structures, shapes, or platform

    Examples

    collapse all

    Create and join a box and a custom 3-D shape.

    b = shape.Box;
    c = shape.Custom3D; 
    s = plus(b,c)
    s = 
      Custom3D with properties:
    
                  Name: 'custom3D'
              Vertices: [23×3 double]
                 Metal: 'PEC'
            Dielectric: 'Air'
        FrequencyModel: 'Constant'
                 Color: 'Individual'
          Transparency: 'Individual'
             EdgeColor: 'Individual'
    
    

    Alternatively, you can directly join shapes using the '+' operator.

    b + c;

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

    This example shows how to create a custom antenna from an element in the antenna catalog.

    Create a default horn antenna and manually mesh it with a maximum edge length of 0.01 m.

    ant = horn;
    feedLoc = ant.FeedLocation;
    m = mesh(ant,MaxEdgeLength=0.01);

    Use triangulation to store the mesh data of this horn antenna.

    p = m.Points';
    t = m.Triangles';
    tr = triangulation(t(:,1:4),p)
    tr = 
      triangulation with properties:
    
                  Points: [327×3 double]
        ConnectivityList: [602×4 double]
    
    

    Use shape.Custom3D to generate a horn shape from triangulation data. Visualize the shape.

    hornShape = shape.Custom3D(tr);
    show(hornShape)

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

    Create a box.

    hole = shape.Box(Length=0.012, Width=0.004, Height=0.005);
    translate(hole,[-hole.Length 0 (hole.Length/2)+hole.Height/2]);

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

    Cut a hole in the horn geometry by subtracting the box from it. Visualize the custom shape.

    hornShape = subtract(hornShape,hole);
    show(hornShape)

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

    Use customAntenna to create a custom antenna from the custom horn shape. Add feed to it and visualize the antenna.

    ant = customAntenna(Shape=hornShape);
    [~] = createFeed(ant,feedLoc,1);
    figure
    show(ant)
    title("Custom Horn Antenna")

    Figure contains an axes object. The axes object with title Custom Horn Antenna, xlabel x (mm), ylabel y (mm) contains 3 objects of type patch, surface. These objects represent PEC, feed.

    This example shows how to create a custom shape using a 3-D trapezoid and sphere.

    Create and view a 3-D trapezoid.

    a = shape.Custom3D(Color=[0.9290 0.6940 0.1250]);
    show(a)

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

    Create and view a sphere.

    b = shape.Sphere(Color=[0.9290 0.6940 0.1250]);
    show(b)

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

    Intersect the 3-D trapezoid with the sphere and view the resultant shape.

    intersect(a,b);

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

    Version History

    Introduced in R2023b

    expand all