psola | Python package implementing the TD-PSOLA algorithm | Speech library
kandi X-RAY | psola Summary
kandi X-RAY | psola Summary
[Issue Count] Implements the TD-PSOLA algorithm.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a pitch mark for a given signal
- Calculate the Hamiltonian
- Difference
- Find all occurrences of x
- Test pitch estimation
- Estimate pitch strength matrix
- Calculate the pitch strength of a peak
- R Compute pitch strength matrix
- Convert a prime number to a prime number
- Convert erbs tohz
- Calculate the erbs
psola Key Features
psola Examples and Code Snippets
Community Discussions
Trending Discussions on psola
QUESTION
I am trying to find a way to get the line (two points in 3D space) of the intersection between two rectangles.
I ran into this question: Intersection between two rectangles in 3D
But this is not my issue. In that question, the rectangle is treated as only the bounds (the perimeter), while I am looking for the rectangle as a whole (think about a picture frame vs the picture itself).
I've figured out that, in every case, there will either be an intersection line (two points), or no intersection at all. If the intersection was just on the borders, therefore just a point, it can be treated as no intersection in my case.
My scenario is that one of these rectangle represents a "static" surface, which cannot move or change. The other one represents a "dynamic" surface, which I have to adapt to avoid crossing
Example:
Once I obtain p1 and p2, which are points in the 3D space, my goal is to modify the Dynamic rectangle into a 3d polygon, which will no longer cross the static rectangle, like this:
So you can see why "edge intersections" are irrelevant to my situation. I am turning "real" intersections into edge intersections, so any edge intersection doesn't require me to do anything with it.
I am only looking for a formula, starting with two sets of 4 points (the rectangles), that would give me the two points of the line of their intersection, or would tell me that there is no (relevant) intersection.
Every formula I've found on this site or others doesn't fit my needs, or doesn't let me input arbitrary rectangles (for example, I can't fix my problem with a formula that uses planes or that treats a rectangle as simply 4 lines)
I am, of course, trying to code it (in C#), therefore any code answer is a great help, but I am confident that even a math-only answer would suffice for me to produce the code from it, therefore I will accept an answer that is only composed of pseudo-code or straight up mathematical formulas, provided they are either simple enough or explained well enough for me to understand what is happening.
...ANSWER
Answered 2019-Jan-03 at 02:11If you are OK with just algorithm rather than full code here is a sketch:
- Build 2 planes from the rectangles (any 3 points will do as in this answer)
- Find the intersection line
I
of those 2 planes as in this answer or find out that the planes are parallel so there is no intersection - Find the intersections of the
I
line with the lines containing all sides of the rectangles as in this answer - Check whether some points found in the previous step lie inside the corresponding sides of the rectangles (line segments). This step potentially can be merged with the previous one, but I put it separately for simplicity. Now you potentially have 0, 1 or 2 segments that represent the intersections of the
I
line with your two rectangles (note that here point is treated as an edge case of a segment where both ends are the same). If you don't have 2 segments, there is no intersection of the rectangles. - Assuming at the previous step you found 2 segments (one in each rectangle) on the line
I
, you just need to find their intersection and it will be your answer (again, empty means no intersection).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install psola
You can use psola like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page