Releases: alexbol99/flatten-js
Fix Shape & Multiline intersection #194
What's Changed
- Fix Shape & Multiline intersection by @stanch in #194
- Fix Shape & Multiline intersection #194 by @alexbol99 in #195
New Contributors
Full Changelog: v1.6.0...v1.6.2
v1.6.0
What's Changed
- Add new methods with multilines by @alexbol99 in #185
- add quotes around with and height svg output in box.js by @bertyhell in #186
- fix readme contain relationship shape a vs b by @bertyhell in #187
- Implement distanceTo function on Box by @bertyhell in #188
New Contributors
- @bertyhell made their first contribution in #186
- @mathedu4all check the shape in Multiline constructor. #161
Full Changelog: v1.5.5...v1.6.0
Add wkt parser
What's Changed
- Support wkt format by @alexbol99 in #181
Add function parseWKT(str)
to utils to convert single WKT element to flatten-js shape.
Type converted as following
POINT -> Point,
LINESTRING -> Multiline
POLYGON -> Polygon
MULTIPOINT -> Array
MULTILINESTRING -> Array
MULTIPOLYGON -> Polygon
GEOMETRYCOLLECTION -> Array<Point | Multiline | Polygon>
Circular arcs and other types not supported
Full Changelog: v1.5.3...v1.5.5
Fix but in polygon cut
What's Changed
- Fix polygon.cut error by @alexbol99 in #177
[help] polygon.cut error: TypeError: Cannot set properties of undefined (setting 'prev') #175 by @Fauny
Full Changelog: v1.5.2...v1.5.3
Fix ray shooting in case of touching faces
What's Changed
- Fixes #171 infinite loop when calling unify for multipolygon with touching faces (case 1 and 2) by @axtavt in #173
- Fix ray shooting algorithm in case of multipolygon with touching faces by @alexbol99 in #174
New Contributors
Full Changelog: v1.5.1...v1.5.2
Fix intersect polygons
What's Changed
- Fix intersectPolygon2Polygon function by @alexbol99 in #168
Full Changelog: v1.5.0...v1.5.1
Issue fixed
- polygon.intersect() function not working in new version (v1.5.0) #166 by @metehan-coone
Cut polygon with multiLine
What's Changed
- Cut polygon with multiline by @alexbol99 in #163
Cut polygon with multiline using methodpolygon.cut()
:
const { point, segment, Polygon, Multiline } = Flatten;
const poly = new Polygon([
point(20, 20),
point(60, 20),
point(60, 60),
point(20, 60)
]);
const segments = [
segment(20, 20, 40, 40),
segment(40, 40, 50, 40),
segment(50, 40, 60, 60)
];
const m = new Multiline(segments);
const newPoly = poly.cut(m);
See notebook cut-polygon-with-multiline-159
Issue fixed
- Cannot cut polygon with MultiLine #159 by @metehan-coone
- Exported type not found issue #165 by @HawtinZeng
Full Changelog: v1.4.8...v1.5.0
Add method 'contains' to Box
What's Changed
- Implementation of 'contains' relation between point and box. by @delmohf in #111
- Box inflate by @delmohf in #113
- Add method 'contains' to Box by @alexbol99 in #160
- Add ability to insert entry to PlanarSet in the form {key: Box, value: Shape}, like
let planarSet = new PlanarSet();
let segment = new Segment(1,2,4,5);
let circle = new Circle(new Point(3,3), 5);
planarSet.add({key: segment.box, value: segment});
planarSet.add({key: circle.box, value: circle});
This change enables to store in PlanarSet shapes that are not part of flatten-js
Full Changelog: v1.4.7...v1.4.8
Reduce npm package size
What's Changed
Removed docs, tests, examples folders from npm package
Package size reduced from 1.1Mb to 219Kb
Full Changelog: v1.4.6...v1.4.7
Export class Errors correcty
What's Changed
- Export errors correctly by @alexbol99 in #158
Class Error exported now, one can check flatten-js errors like this:
import {Errors, vector} from "@flatten-js/core";
try {
const v = vector(0,0)
v.normalize()
}
catch (e) {
console.log(e.message === Errors.ZERO_DIVISION.message)
}
- Related issue
Errors export #157 by @edemaine
Full Changelog: v1.4.5...v1.4.6