Main Content

shape.Sphere

Create sphere centered at origin

Since R2023b

    Description

    The shape.Sphere lets you create a sphere with metal and dielectric material properties centered at the origin. Use this sphere along with the other shapes and the geometric operations to create a shape for the custom antenna.

    Creation

    Description

    sph = shape.Sphere creates a sphere centered at the origin.

    sph = shape.Sphere(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

    Sphere name, specified as a string.

    Example: "Sphere1"

    Data Types: string

    Sphere center point, specified as a three-element vector of Cartesian coordinates in meters.

    Example: [1 1 1]

    Data Types: double

    Radius of the sphere, specified as a scalar in meters.

    Example: 2

    Data Types: double

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

    Example: "Copper"

    Data Types: string

    Dielectric material of the shape, specified as a dielectric name string from the Dielectric Catalog.

    Example: "Teflon"

    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
    showDisplay antenna, array structures, shapes, or platform
    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
    removeFacesInteractively select and remove 3-D shape faces
    addSubstrateAdd dielectric substrate to metal shape

    Examples

    collapse all

    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.

    This example shows how to create a hollow square nut shape by carving out a sphere from a box shape.

    Create and view a spherical shape.

    a = shape.Sphere;
    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 box shape.

    b = shape.Box;
    show(b)

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

    Carve out the sphere from the box and view the resultant shape.

    minus(b,a);

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

    Version History

    Introduced in R2023b