I want to count specific subshapes of a bigger shape with python. For expample: I draw a Triangle. I draw a diagonal line cutting the triangle in half. Now the program show draw this triangle with the intersecting line and count the amount of triangles drawn. In this case, it should return three because there is the big triangle drawn in the beginning and the two triangles created when cutting the first on in half. I have no clue where to start nor which library to choose. Has someone an idea?
Python: count specific subshapes in shape with intersecting lines
226 Views Asked by LeeLii100 At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in GEOMETRY
- Generating a sphere in OpenGL without high level libraries - what's wrong with my code?
- Matrix (?) to Rectangle and vise versa
- Turn a button into a loading circle animation
- Find a longitude given a pair of (lat,long) and an offset latitude
- 2D perspective transform in JavaScript
- how to convert Oracle geometry to SQL GEOMETRY
- Overlapping Rectangles Javascript
- Detect hole in geometry
- Reversing RotateAxisAngle back to angles
- WPF: 2 string.format in the same TextBlock?
- Quaternion to EulerXYZ, how to differentiate the negative and positive quaternion
- How to find a point given its distance from two other points?
- Ray/Rectangle intersection in 3D space
- Pairs of points on a graph
- Android OpenCV Detecting Circles takes too much FPS
Related Questions in SHAPES
- ggplot2 shapes by variables with replicates
- PPT VBA: Capturing Screen Shot inside Shape
- Use XAML StringFormat to get one decimal place
- WPF: 2 string.format in the same TextBlock?
- CSS: Text-width based quadrilateral button
- How to make the arc corners go out not in with a Three.js Shape
- How to define custom shape, as click-able area for anchor tag? (cross-browser)
- Problems on Python Code using Theano
- Draw arbitrary convex shape knowing the lengths of its sides
- How to create a sphere in css?
- How to recognize the shape of traffic sign?
- How to create an indent in shaped control that allows painting on indented region?
- How to set background image on the right hand side of a shape in android
- Css shapes support in IE/Firefox
- Flash CS6/as3: Using cursor to draw rectangle dynamically in a published swf
Related Questions in TRIANGLE-COUNT
- Number of triangles with N points inside
- problem with triangle angle in programm language C++
- Triangle , C++ construction, problem with calculating angles
- Divisors of triangle numbers (Euler 12)
- How do I let my program print a complete right angle triangle for certain values?
- How to generate a triangle free graph in Networkx (with randomseed)?
- C For Loop Floyd's Triangle but different?
- Displaying large VRML file
- Triangle Counting/Clustering Neo4j
- How to find a "triangle of friends" in a graph?
- Triangle count for model is doubled during render
- How I can copy triangle shape numbers in Python
- Unity-3D how can i see polygon count in mobile phone?
- Count Triangles in Scala - Spark
- Python: count specific subshapes in shape with intersecting lines
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?
My approach to this is to first find all the vertices and intersection of the lines (inside the triangle), and then loop through all combinations of points to see if that can form a triangle. I'm using the library shapely to check intersections.
Output:
To visualize:
It draws: