Skip to content

Add support for multiple FOV types in SpecularCoverage class #12

@ryanketzner

Description

@ryanketzner

Currently, the SpecularCoverage class only works with CircularFieldOfVIew, but it can easily be extended to any FOV like the other CoverageCalculator class. From coveragecalculator.py:

if isinstance(fov, CircularFieldOfView):
    deg2rad = math.pi / 180.0
    half_angle_rad = fov.diameter * 0.5 * deg2rad
    boresight_fov_gte = gte.Vector3d(fov.boresight)

    # First, define the boresight vector and cone angle in the FOV frame as a constant
    # source.
    boresight_fov_source = kcl.ConstantSourceVector3d(boresight_fov_gte)
    angle_source = kcl.ConstantSourced(half_angle_rad)

    # Define a source which transforms the boresight from the FOV frame to the targe frame.
    # This is a Variable object so it must be added to the variables list to be updated.
    boresight_target_source = kcl.TransformedVector3dSource(
        boresight_fov_source, fov_to_target_source, buff_size
    )

    # Define a source which builds a cone object using the FOV position, boresight
    # unit vector, and cone half-angle.
    # This is a Variable object so it must be added to the variables list to be updated.
    fov_source = kcl.PosDirConeSource(
        pos_fov_target_source,
        boresight_target_source,
        angle_source,
        buff_size,
    )

    # Define a Viewer object for the cone shape. Viewer objects are used to make the shape
    # compatible with constructive solid geometry (CSG) operations.
    fov_viewer = kcl.ViewerCone3d(fov_source)

    # Add variables to list
    variables.append(boresight_target_source)
    variables.append(fov_source)
else:
    raise ValueError("Unsupported field of view type.")

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions