[英]Getting the coordinate pairs of a Path2D object in Java?
我必須獲取Path2D對象中每組坐標的坐標,但我不知道如何。 以前我們使用的是Polygons,所以我能夠初始化兩個長度為Polygon.npoints數組,然后將它們設置為Polygon.xpoints和Polygon.ypoints數組。 現在我們正在使用Path2D對象,我不知道如何執 ...
[英]Getting the coordinate pairs of a Path2D object in Java?
我必須獲取Path2D對象中每組坐標的坐標,但我不知道如何。 以前我們使用的是Polygons,所以我能夠初始化兩個長度為Polygon.npoints數組,然后將它們設置為Polygon.xpoints和Polygon.ypoints數組。 現在我們正在使用Path2D對象,我不知道如何執 ...
[英]PathIterator for java.awt.Rectangle always gives (0,0)
在我的代碼中,我創建了一個java.awt.Rectangle實例,其實例帶有一個corner,length和width 。 然后,在其上應用旋轉仿射變換 (),將其旋轉一定角度。 然后,我獲取矩形的PathIterator並將幾何迭代為: 雖然我希望得到4分(或者說第一個和最后 ...
[英]The method currentSegment(float[]) in the type PathIterator is not applicable for the arguments (Double[])
我正在嘗試在Java程序中讀取Path2D.Double的Segments,Eclips不斷告訴我: PathIterator類型的currentSegment(float [])方法不適用於參數(Double []) 但是在PathIterator接口中,有2種方法似乎使Eclip ...
[英]Java PathIterator - How do I accurately calculate center of Shape object?
我正在嘗試使用PathIterator計算任何Shape對象的中心,以便可以考慮彎曲路徑,但是在找到標准1x1矩形的中心時,我的getCenter()方法返回了該點: 我的getCenter()方法: 我發現在打印points.toString()時,我在控制台中得到了這個: ...
[英]Can't figure out what flattnes parameter does in PathIterator?
我正在編寫自己的PathIterator實現。 目前我實現了平坦度無平坦度的方法: 即我無視它。 使用flatness參數的最簡單方法是什么? 我當前的迭代器給出了一系列平行的垂直線(之間沒有連接)。 對我來說實現迭代器的平坦度感知版本有多重要? 在哪里使用? ...
[英]Java PathIterator clockwise or counterclockwise?
Java PathIterator是否按順時針或逆時針順序為您提供多邊形的點? ...
[英]How to check for Shape intersection using GeneralPath? Java
我有一個程序,允許您移動各種形狀。 我希望能夠返回一個布爾值,如果兩個形狀相交,則返回true。 這是我到目前為止: ...其中path是一個GeneralPath(這些都是直接來自API,MyShape除外)。 我不確定的一件事是PathIterator如何工作,這可能是問題 ...
[英]Using PathIterator to return all line segments that constrain an Area?
在Java中,如何使用PathIterator迭代約束Area線段? Area僅由線條約束(但曲線支撐不會受到傷害)。 該方法應返回所有線段的集合。 ...