Skip to content

Generic interface for both integer and floating-point triangulation #11

@mikwielgus

Description

@mikwielgus

It would be nice to not have to decide whether to use floats or integers. Currently, it seems to me that this is impossible -- IntTriangulation works only on i32, whereas Triangulator::triangulate() requires the scalar type to implement FloatNumber, which is currently only implemented for f32 and f64.

It should be possible to use traits to make the current floating-point triangulation interface more generic to also accept integers by implementing the current conversion from and to floats as an identity map for integers.

This would be useful for me because I have a preference for writing code that is generic over both integers and floats to cover more applications. Though in computer graphics, video games, and mechanical CADs floating-point coordinates have been the usual choice for over two decades, fixed-point integer coordinates do not suffer from numerical inrobustness and continue to be widely used in EDA software.

Metadata

Metadata

Assignees

No one assigned

    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