Dear David,
first of all many thanks for this nice library. I am using it for an Android application where using the normal java.awt classes is not possible in general. In particular, I need this library for the GCPJ functions.
1)
Your previous fix for the other gentleman in this forum to get rid of java.awt.Point worked well, however, the GCPJ library itself depends on AWT Point2D and Rectangle2D. Thus, the GCPJ function do not work innately. I came up with a workaround by providing my own Point2D and Rectangle2D classes and then renaming the packages with jarjar. If I want to fix this in a more clean way, I would need the GCPJ sources. Where can I download these?
3)
Which compiler do you use to compile javaGeom? I get some error messages regarding compatibility issues with generics, for instance name clash for create method in CurveArray2D and ContourArray2D. Is there any reason why ant is not used for building the project?
Best Regards,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for using the library (andt hanks for your very nice review!)
Concerning your questions:
1) I made some modifications on source code for GPCJ (found on web archive for seisw company). I have just published the jar, but I will also add the modified sources (in few days should be ok).
I will also try to remove dependency to at point as welll, that should not be that time consuming.
2) I actually included some code for polygon "buffering", that is, computing offset with round corners. This can be found in package circulinear/buffer. This can be accessed through the "getBuffer" method, defined for polygons (and more generally for any shapes composed of line parts and/or circle parts, shapes that I have called "circulinear").
I recently made changes to accept more types of corners (round, bevel, miter), via the "JoinFactory" Interface. You can try to play with it. However, I used quite naive algorithm, and there are surely a lot of bugs remaining, so handle with care…
I try to improve it from time to time, maybe I will try to code a specific version for polygon, but not in a near time.
3) concerning compiler, I use java compiler version=1.6.0_26, under Windows and using Eclipse platform. javaGeom is compiled with compatibility version for 1.5, so any compiler > 1.5 should be ok. I know ant by name, but never tried to use it…. I'll check if I have time.
Best regards,
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Great, thank you. I am looking forward to the next release :)
2) Yeah, I already saw the getBuffer. First, wondered how i can transform the CirculinearDomain2D to a Polygon2D again. Is there something like a PathIterator that will transform curves into lines with a give tolerance? - One the other hand, I dont want rounded corners. However, I then simply implemented my own algorithm which is very simple by using the parallels because I have only convex polygons without holes and I only need the outward polygon. I then later saw that you have a deprecated method in the Polyline2DUtils …
3) I tested it with 1.6.0_27 and 1.7.0_02 and it does not compile in both cases. I will investigate this further when I have some more time. Maybe you will find some time to test it with other compilers. Ant is a replacement for make or the batch files you have right now for building. Once it compiles on my side, I can simply write such an Ant script for the whole and then it can be easily compile and packed and tested, etc. inside Eclipse.
Best Regards,
Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've released javaGeom 0.10.1, that removes dependency of GPCJ to Java point.
For transforming circulinear domains to polygons, you can try to iterate on smooth curves of the boundary, and extract the extreme points. That can be tedious… If polygons are convex, maybe it will be easier to build your own function.
For compilation, have you included GPCJ lib ?
You can get full source from subversion repository, including tests and basic applets for checking specific cases. Maybe it's better than the source archive.
Concerning polygons, I have checked the Clipper library, given in your link. Sounds better than gpcj (more stable). there's no Java version for the moment, but it does not seem too complicated to translate. I will maybe try to adapt it, and make a version less dependant with circulinear shapes.
regards,
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear David,
first of all many thanks for this nice library. I am using it for an Android application where using the normal java.awt classes is not possible in general. In particular, I need this library for the GCPJ functions.
1)
Your previous fix for the other gentleman in this forum to get rid of java.awt.Point worked well, however, the GCPJ library itself depends on AWT Point2D and Rectangle2D. Thus, the GCPJ function do not work innately. I came up with a workaround by providing my own Point2D and Rectangle2D classes and then renaming the packages with jarjar. If I want to fix this in a more clean way, I would need the GCPJ sources. Where can I download these?
2)
Do you plan to implement algorithms for inward/outward calculation of polygons within the next time?
see: http://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons
3)
Which compiler do you use to compile javaGeom? I get some error messages regarding compatibility issues with generics, for instance name clash for create method in CurveArray2D and ContourArray2D. Is there any reason why ant is not used for building the project?
Best Regards,
Martin
hey.. how u fixed previous problem?? i have also a problem like ur's previous one..please help
Hi Martin,
Thanks for using the library (andt hanks for your very nice review!)
Concerning your questions:
1) I made some modifications on source code for GPCJ (found on web archive for seisw company). I have just published the jar, but I will also add the modified sources (in few days should be ok).
I will also try to remove dependency to at point as welll, that should not be that time consuming.
2) I actually included some code for polygon "buffering", that is, computing offset with round corners. This can be found in package circulinear/buffer. This can be accessed through the "getBuffer" method, defined for polygons (and more generally for any shapes composed of line parts and/or circle parts, shapes that I have called "circulinear").
I recently made changes to accept more types of corners (round, bevel, miter), via the "JoinFactory" Interface. You can try to play with it. However, I used quite naive algorithm, and there are surely a lot of bugs remaining, so handle with care…
I try to improve it from time to time, maybe I will try to code a specific version for polygon, but not in a near time.
3) concerning compiler, I use java compiler version=1.6.0_26, under Windows and using Eclipse platform. javaGeom is compiled with compatibility version for 1.5, so any compiler > 1.5 should be ok. I know ant by name, but never tried to use it…. I'll check if I have time.
Best regards,
David
updated gpcj2:
https://sourceforge.net/projects/geom-java/files/gpcj/gpcj-2.2.0/
you can find binaries and sources, with dependency to java.awt.Point2D removed. Will be included in javageom in a next release.
regards,
David
Hi David,
1) Great, thank you. I am looking forward to the next release :)
2) Yeah, I already saw the getBuffer. First, wondered how i can transform the CirculinearDomain2D to a Polygon2D again. Is there something like a PathIterator that will transform curves into lines with a give tolerance? - One the other hand, I dont want rounded corners. However, I then simply implemented my own algorithm which is very simple by using the parallels because I have only convex polygons without holes and I only need the outward polygon. I then later saw that you have a deprecated method in the Polyline2DUtils …
3) I tested it with 1.6.0_27 and 1.7.0_02 and it does not compile in both cases. I will investigate this further when I have some more time. Maybe you will find some time to test it with other compilers. Ant is a replacement for make or the batch files you have right now for building. Once it compiles on my side, I can simply write such an Ant script for the whole and then it can be easily compile and packed and tested, etc. inside Eclipse.
Best Regards,
Martin
Hi Martin,
I've released javaGeom 0.10.1, that removes dependency of GPCJ to Java point.
For transforming circulinear domains to polygons, you can try to iterate on smooth curves of the boundary, and extract the extreme points. That can be tedious… If polygons are convex, maybe it will be easier to build your own function.
For compilation, have you included GPCJ lib ?
You can get full source from subversion repository, including tests and basic applets for checking specific cases. Maybe it's better than the source archive.
Concerning polygons, I have checked the Clipper library, given in your link. Sounds better than gpcj (more stable). there's no Java version for the moment, but it does not seem too complicated to translate. I will maybe try to adapt it, and make a version less dependant with circulinear shapes.
regards,
David