1 / 23

Geometric Primitives Code and Examples

This lecture focuses on geometric primitives, including cross products, determining areas of polygons, and segment intersection tests. It also covers additional primitives and their properties.

Download Presentation

Geometric Primitives Code and Examples

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AMS 345/CSE 355 Computational Geometry Joe Mitchell Lecture: Geometric Primitives Code/figures from [O’Rourke]: Computational Geometry in C: Chap 1

  2. Cross Products c b a

  3. Cross Products c=(2,2) b=(2,1) a d=(0,-1) • Example: • ab × ac = [2,1] × [2,2] = (2*2-2*1) = 1 • ab × ad = [2,1] × [0,-1] = (2*(-1)-0*1) = -2

  4. Determinant Form

  5. Area of Convex Polygon

  6. Area of Simple Polygon

  7. Point Type

  8. Vertex Structure

  9. NEW and ADD

  10. b c a

  11. Proper Segment Intersection Fact: ab and cd properly intersect if and only if (1) points a and b are on opposite sides of line cd, AND (2) c and d are on opposite sides of line ab

  12. Improper Segment Intersection

  13. Between b c a b c a

  14. Segment Intersection

  15. Diagonalie Test if segment ab, joining vertices a and b, forms a “diagonalie” = an interior or exterior diagonal for P. Check: does the segment ab avoid intersecting all edges of P, except those that share endpoints with ab? a a b b a b

  16. InCone

  17. InCone b a0 a1 a b a a1 a0

  18. Diagonal

  19. Additional Primitives ConvexVertex(a,P) – returns T iff a is a convex vertex of P RaySegIntersectProp RayRayIntersectProp RaySegIntersect, RayRayIntersect SegSegShareEndptOnly SegSegT-Intersect PointInTriangle SegInPolygon Etc, etc

  20. From Practice Midterm

  21. From Practice Midterm

More Related