Path-Planning | stricted visited list , Lifelong Planning | Machine Learning library
kandi X-RAY | Path-Planning Summary
kandi X-RAY | Path-Planning Summary
Implementation for A* with stricted visited list, Lifelong Planning A* and D* Lite final version
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Path-Planning
Path-Planning Key Features
Path-Planning Examples and Code Snippets
Community Discussions
Trending Discussions on Path-Planning
QUESTION
My program is one where you can place points of a field drawing from an FRC competition and then you can see the path that you have defined using those points.
The first step of the program is calibrating (finding the pixel to real distance scale) and I am currently adding the functionality of defining the field (the field walls, obstacles, etc...). I am first trying to define the field borders. To do this I was thinking about selecting points on the drawing and then add them to a polygon, then subtracting the polygon from a rectangle the same size as the field image.
The problem is that when testing this it shows my subtracted shape offset for some reason. I have looked at the StackOverflow question about Shape.intersect
, however, it does not help. I have checked all the layout positions, scales, etc. of the AnchorPane
and its children I place inside of it, but it all returns either 0 or 1s.
Here is a drawing of what it returns:
The red rectangle is the rectangle that is the size of the image.
The purple is the overlap between the rectangle and the polygon selected.
The grey is the Shape.subtract()
resultant.
What I want is that the Shape.substract
(the grey) has its empty spot on top of the purple and fit perfectly. But as you can see in this image the purple overlaps with the grey.
This is how I want it to look like:
Here is a testing environment I have created to reproduce the phenomenon:
Main.java
...ANSWER
Answered 2018-Jul-31 at 12:32The problem is the result of a combination of 2 factors: padding and node hierarchy; and might be a bug. The important point to note is from subtract
's doc:
Before the final operation the areas of the input shapes are transformed to the parent coordinate space of their respective topmost parent nodes.
Which means that it matters where the nodes are in the hierarchy when the subtraction is made. If the nodes are in a parent with padding, it is taken into account during the coordinate transforms, and that causes the shift you see.
Your simple workarounds are either to remove the padding on the problematic side(s) (depends on the alignment in the node), translate the shifted node by the padding amount (cancelling the padding shift), or to add the polygon to the hierarchy after the subtract operation where you add subtract
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Path-Planning
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