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

Modify offset method to work in the edge to outside direction. #7

Open
saeranv opened this issue Mar 9, 2020 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@saeranv
Copy link
Member

saeranv commented Mar 9, 2020

Currently the offset only works inward, given that the straight skeleton only works inwards. I think we can add this functionality simply by inverting the angle bisector rays, and trimming the corresponding edges.

In certain concave geometry cases, this will cause self-intersecting edges, but I think this is an edge case we can ignore. If needed to, we can include an option to eliminate self-intersection by using the method we used in the thermal zone component to find all intersections and traverse the outer edge. In the thermal zone component, this is constrained to each edge polygon, whereas in the offset case checking for self-intersection for every edge with every other edge has a O(n^2) time complexity (can be reduced if we used something like a quadtree to store edges).

@saeranv saeranv self-assigned this Mar 9, 2020
@saeranv saeranv added the enhancement New feature or request label Mar 9, 2020
@saeranv
Copy link
Member Author

saeranv commented Apr 24, 2020

Update: Since I've managed to get holes working for the polyskeleton, I've decided to use the method CGAL uses for outward-facing offsets, which exploits the hole property of straight skeletons:
https://doc.cgal.org/Manual/3.2/doc_html/cgal_manual/Straight_skeleton_2/Chapter_main.html (in section 16.3.2 Example).

The tricky part, which we won't be implementing immediately is dynamically computing a frame buffer: https://doc.cgal.org/Manual/3.2/doc_html/cgal_manual/Straight_skeleton_2_ref/Function_compute_outer_frame_margin.html#Cross_link_anchor_646, which requires translating this code: https://doc.cgal.org/Manual/3.2/include/CGAL/compute_outer_frame_margin.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant