Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VectorUtil refactor #95

Merged
merged 6 commits into from
Aug 2, 2021
Merged

VectorUtil refactor #95

merged 6 commits into from
Aug 2, 2021

Conversation

rihi
Copy link
Collaborator

@rihi rihi commented Mar 10, 2020

Introduction

With #57 I introduced the VectorUtil class used for the Areaportal/Occluder mapper. The purpose of its methods is to compare Windings by their surface area and get the overlap as a percentage. Internally this is done by first testing if both windings share a common plane and then converting them to 2 dimensional convex polygons to make comparison easy.

Changes

Previously, all relevant calculations were all done in the VectorUtil class. To make the class less bloated with methods, this pr transfers some of that code into a new class called ConvexPolygon. As the name already suggest, this is a class which represents a convex polygon defined by a list of vertex positions.

Additionally, there are also some improvements to the javadoc and the algorithm for testing if a position is inside a convex polygon has been change to a different one.

Practically, this pr shouldn't change anything visible to the user but rather just improve code readability and reusability.

rihi added 6 commits March 10, 2020 00:09
VectorUtil is only used by the AreaportalMapper and OccluderMapper
class, so it really should be in bspsrc instead of
bsplib.
This refactors code dealing with convex polygons from the VectorUtil
class into a separate ConvexPolygon class. Additionally javadoc has
been added.
@ata4 ata4 merged commit aec4c81 into ata4:master Aug 2, 2021
@rihi rihi deleted the refactor/vector-util branch August 3, 2021 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants