Say I have two polygons, A and B.
Polygon A has points at (0,0), (0, 5), and (5, 0)
Polygon B has points at (-2, 2), (5, 5), and (5, 2)
My goal is to split this in to 3 different polygons
Polygon 1 would be Polygon A - where it intersects Polygon B
Polygon 2 would be Polygon B - where it intersects with Polygon A
Polygon 3 would be the intersection area.
For polygons 1 and 2, I could use java's geom.area.intersect method.
How would I go about creating polygon 3?
creating polygons based on intersection
323 Views Asked by James McDowell At
1
There are 1 best solutions below
Related Questions in JAVA
- Add image to JCheckBoxMenuItem
- How to access invisible Unordered List element with Selenium WebDriver using Java
- Inheritance in Java, apparent type vs actual type
- Java catch the ball Game
- Access objects variable & method by name
- GridBagLayout is displaying JTextField and JTextArea as short, vertical lines
- Perform a task each interval
- Compound classes stored in an array are not accessible in selenium java
- How to avoid concurrent access to a resource?
- Why does processing goes slower on implementing try catch block in java?
- Redirect inside java interceptor
- Push toolbar content below statusbar
- Animation in Java on top of JPanel
- JPA - How to query with a LIKE operator in combination with an AttributeConverter
- Java Assign a Value to an array cell
Related Questions in ALGORITHM
- Two different numbers in an array which their sum equals to a given value
- Given two arrays of positive numbers, re-arrange them to form a resulting array, resulting array contains the elements in the same given sequence
- Time complexity of the algorithm?
- Find a MST in O(V+E) Time in a Graph
- Why k and l for LSH used for approximate nearest neighbours?
- How to count the number of ways of choosing of k equal substrings from a List L(the list of All Substrings)
- Issues with reversing the linkedlist
- Finding first non-repeating number in integer array
- Finding average of an array
- How to check for duplicates with less time in a list over 9000 elements by python
- How to pick a number based on probability?
- Insertion Sort help in javascript -- Khan Academy
- Developing a Checkers (Draughts) engine, how to begin?
- Can Bellman-Ford algorithm be used to find shorthest path on a graph with only positive edges?
- What is the function for the KMP Failure Algorithm?
Related Questions in POLYGON
- How can i add polygon on google maps IOS?
- Polygon shape margin in Java
- SVG simple animations
- Newbe help on getting from polygon shape file to Leaflet polygon
- creating polygons based on intersection
- R polygon: fill values >0 in a density plot
- CSS Container Wrap shaped Polygons
- position polygon accurately in Corona SDK? (relative to known vertices - issue is it creates it own centre
- Extracting polygon given coordinates from an image using OpenCV
- Draw arbitrary convex shape knowing the lengths of its sides
- Scale animation on polygon
- Get the mesh name from the selected vertex
- oracle spatial compute area of polgons inside a class of polygon group by polygon ID
- How can I create an internal spiral for a polygon?
- Drawing filled polygon with libGDX's earclippingtriangulator and PolygonSpriteBatch
Related Questions in INTERSECTION
- Math/Physics: Given angle and vector find point of intersection?
- Java 2D game random rectangles
- How can I find a common volume of three cones intersecting each other in MATLAB?
- creating polygons based on intersection
- Ray/Rectangle intersection in 3D space
- Intersecting many Points with many Polygons
- Program not outputting data correctly
- Getting Geometry of Intersection of Road SQL and Inserting Into Table
- Finding n numbers common over N lists
- Intersection of data in oracle
- How to split a self-intersection polygon to multipolygon
- Find the Intersection points of 2 rectangles
- how to check if two points are on the same line in postgis
- How to Check intersection between two images on a specific location?
- SVG intersection of elements with transforms
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Polygons 1, 2 and 3 are the same thing. :-)
You can get Area Gamma by using intersect().
Then you can subtract() Area Gamma from Polygon A to get Area Alpha (the part of A that's outside Gamma), and subtract() Gamma from B to get Beta (the part of B that's outside Gamma).
To convert back from Area to Polygon, collect the vertex points for each Area using getPathIterator(null), then feed them into the Polygon constructor.