Skip to content

Commit

Permalink
up version
Browse files Browse the repository at this point in the history
  • Loading branch information
NailxSharipov committed Jan 17, 2025
1 parent dff31b0 commit 2cdd70e
Show file tree
Hide file tree
Showing 9 changed files with 1,003 additions and 248 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ishape_wasm"
version = "1.1.4"
version = "1.1.5"
authors = ["Nail Sharipov <nailxsharipov@gmail.com>"]
edition = "2021"
description = "Boolean Operations for 2D Polygons. Supported operations: intersection, union, difference, XOR, and self-intersections for all polygon varieties."
Expand All @@ -16,8 +16,8 @@ codegen-units = 1
crate-type = ["cdylib"]

[dependencies]
#i_overlay = "~1.9.0"
i_overlay = { path = "../iOverlay" }
i_overlay = "~1.9.4"
#i_overlay = { path = "../iOverlay" }
#log = "0.4.22"
#console_log = "^1.0.0"
#console_error_panic_hook = "^0"
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mdbook build

# pkg
npm login
npm publish ishape_wasm-1.1.2.tgz
npm publish ishape_wasm-1.1.5.tgz
746 changes: 746 additions & 0 deletions docs-gen/src/overlay/extract/extract_inner_contour_clockwise.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs-gen/src/overlay/extract/extract_shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Once we apply boolean filter to [Overlay Graph](../overlay_graph/overlay_graph.m
### Outer Contour
![Extract Contour](extract_outer_contour.svg)
### Inner Contour
![Extract Contour](extract_inner_contour.svg)
![Extract Contour](extract_inner_contour_clockwise.svg)

The algorithm starts by selecting the leftmost node and proceeds by choosing the topmost segment connected to that node. The process continues by traversing to the next node along the selected segment.

At each node, the algorithm selects the next segment by rotating around the current node in a counterclockwise direction and taking the first nearest segment.
At each node, the algorithm selects the next segment by rotating around the current node in a clockwise/counterclockwise direction for inner/outer contours and taking the first nearest segment.

To prevent segments from being visited twice, each segment is marked as visited upon traversal.

Expand Down
27 changes: 7 additions & 20 deletions pkg/ishape_wasm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,10 @@ export enum ShapeType {
Clip = 1,
}
export class Overlay {
private constructor();
free(): void;
/**
* @param {any} subj_js
* @param {any} clip_js
* @returns {Overlay | undefined}
*/
static new_with_subj_and_clip(subj_js: any, clip_js: any): Overlay | undefined;
/**
* @param {OverlayRule} overlay_rule
* @param {FillRule} fill_rule
* @returns {any}
*/
overlay(overlay_rule: OverlayRule, fill_rule: FillRule): any;
/**
* @param {FillRule} fill_rule
* @returns {any}
*/
separate_vectors(fill_rule: FillRule): any;
}

Expand All @@ -45,14 +32,14 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
export interface InitOutput {
readonly memory: WebAssembly.Memory;
readonly __wbg_overlay_free: (a: number, b: number) => void;
readonly overlay_new_with_subj_and_clip: (a: number, b: number) => number;
readonly overlay_overlay: (a: number, b: number, c: number) => number;
readonly overlay_separate_vectors: (a: number, b: number) => number;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly overlay_new_with_subj_and_clip: (a: any, b: any) => number;
readonly overlay_overlay: (a: number, b: number, c: number) => any;
readonly overlay_separate_vectors: (a: number, b: number) => any;
readonly __wbindgen_exn_store: (a: number) => void;
readonly __externref_table_alloc: () => number;
readonly __wbindgen_export_2: WebAssembly.Table;
readonly __wbindgen_malloc: (a: number, b: number) => number;
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
readonly __wbindgen_start: () => void;
}

Expand Down
Loading

0 comments on commit 2cdd70e

Please sign in to comment.