lycantropos / gon Goto Github PK
View Code? Open in Web Editor NEWGeometries processing
Home Page: https://gon.rtfd.io
License: MIT License
Geometries processing
Home Page: https://gon.rtfd.io
License: MIT License
We need a way to check if polygon is contained inside another one.
API may be similar to Python's set
/frozenset
types:
<=
for "is subset",<
for "is proper subset",>=
for "is superset",>
for "is proper superset".We need a way to construct difference of two geometries.
API may be similar to Python's set
/frozenset
types:
-
for difference.
We need to be able to scale geometries by given factor.
Adding method like
def scale(self, ratio_x: Coordinate, ratio_y: Optional[Coordinate] = None) -> Geometry:
if ratio_y is None:
ratio_y = ratio_x
...
will help.
Since it is a very useful techique to decompose polygon into set of simpler ones (and triangles are the simplest polygons), we need a support for it too.
We need to be able to translate geometries by given step.
Adding method like
def translate(self, step_x: Coordinate, step_y: Optional[Coordinate] = None) -> Geometry:
if step_y is None:
step_y = step_x
...
will help.
We need a way to check if polygons do not overlap, or in other words -- if polygons are disjoint.
API may be a method called is_disjoint_with
that takes 2 polygons: self
& other
, similar to __eq__
& other rich comparison methods.
We need to be able to rotate geometries around given point by given angle.
Adding method like
def rotate(self, angle: Coordinate, point: Optional[Point] = None) -> Geometry:
result = (self
if point is None
# move origin to point
self.translate(-point.x, -point.y))
... # rotate around origin
return (result
if point is None
# move origin back
result.translate(point.x, point.y))
will help.
We need a way to construct intersection of two polygons: empty for non-overlapping ones and non-empty otherwise.
API may be similar to Python's set
/frozenset
types:
&
for intersection.
We need a way to construct symmetric difference of two geometries.
API may be similar to Python's set
/frozenset
types:
^
for symmetric difference.
We need a way to construct union of two polygons: disjoint for non-overlapping ones and "merged" otherwise.
API may be similar to Python's set
/frozenset
types:
|
for union.
Hi,
I am working on a project with character shapes and I need to triangulate some polygons with holes (e.g. the character B). Does your project offer any possibility to solve such a problem?
Cheers,
We need to be able to calculate distance between geometries.
Adding method like
def distance_to(self, other: Geometry) -> Coordinate:
...
will help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.