Skip to content

Commit fe4480b

Browse files
Merge pull request #49 from bretttully/gh-48/fix-naming-typo
GH-48 fix OGC naming typo
2 parents 6d0fa3b + b4f05a8 commit fe4480b

11 files changed

Lines changed: 39 additions & 39 deletions

File tree

iOverlay/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ If you need more control, use `FloatPointAdapter::with_scale` and `FloatOverlay:
449449

450450
### 4. How do I enable OGC-valid output?
451451

452-
Set the `ocg` flag in `OverlayOptions`.
452+
Set the `ogc` flag in `OverlayOptions`.
453453

454454
```rust
455455
use i_overlay::core::fill_rule::FillRule;
@@ -478,7 +478,7 @@ let clip = vec![
478478
vec![[2.0, 1.0], [2.0, 2.0], [3.0, 2.0], [3.0, 3.0], [4.0, 3.0], [4.0, 1.0]],
479479
];
480480

481-
let options = OverlayOptions::<f64>::ocg();
481+
let options = OverlayOptions::<f64>::ogc();
482482
let mut overlay = FloatOverlay::with_subj_and_clip_custom(&subj, &clip, options, Default::default());
483483
let result = overlay.overlay(OverlayRule::Difference, FillRule::EvenOdd);
484484

iOverlay/src/core/extract.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ impl OverlayGraph<'_> {
5252
buffer: &mut BooleanExtractionBuffer,
5353
) -> IntShapes {
5454
self.links.filter_by_overlay_into(overlay_rule, &mut buffer.visited);
55-
if self.options.ocg {
56-
self.extract_ocg(overlay_rule, buffer)
55+
if self.options.ogc {
56+
self.extract_ogc(overlay_rule, buffer)
5757
} else {
5858
self.extract(overlay_rule, buffer)
5959
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use i_shape::int::shape::IntShapes;
1313
use i_shape::util::reserve::Reserve;
1414

1515
impl OverlayGraph<'_> {
16-
pub(crate) fn extract_ocg(
16+
pub(crate) fn extract_ogc(
1717
&self,
1818
overlay_rule: OverlayRule,
1919
buffer: &mut BooleanExtractionBuffer,

iOverlay/src/core/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
pub mod overlay;
2-
pub mod solver;
3-
pub mod graph;
4-
pub mod overlay_rule;
1+
pub mod divide;
2+
mod extract_ogc;
53
pub mod extract;
64
pub mod fill_rule;
7-
pub mod simplify;
5+
pub mod graph;
86
pub(crate) mod link;
97
pub(crate) mod nearest_vector;
10-
pub mod divide;
11-
mod exract_ocg;
8+
pub mod overlay;
9+
pub mod overlay_rule;
10+
pub mod simplify;
11+
pub mod solver;

iOverlay/src/core/overlay.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub struct IntOverlayOptions {
4040
pub min_output_area: u64,
4141

4242
/// If true, extract OGC-valid shapes.
43-
pub ocg: bool,
43+
pub ogc: bool,
4444
}
4545

4646
/// Specifies the type of shape being processed, influencing how the shape participates in Boolean operations.
@@ -382,7 +382,7 @@ impl Default for IntOverlayOptions {
382382
output_direction: ContourDirection::CounterClockwise,
383383
preserve_output_collinear: false,
384384
min_output_area: 0,
385-
ocg: false,
385+
ogc: false,
386386
}
387387
}
388388
}
@@ -394,7 +394,7 @@ impl IntOverlayOptions {
394394
output_direction: ContourDirection::CounterClockwise,
395395
preserve_output_collinear: true,
396396
min_output_area: 0,
397-
ocg: false,
397+
ogc: false,
398398
}
399399
}
400400
pub fn keep_output_points() -> Self {
@@ -403,16 +403,16 @@ impl IntOverlayOptions {
403403
output_direction: ContourDirection::CounterClockwise,
404404
preserve_output_collinear: true,
405405
min_output_area: 0,
406-
ocg: false,
406+
ogc: false,
407407
}
408408
}
409-
pub fn ocg() -> Self {
409+
pub fn ogc() -> Self {
410410
Self {
411411
preserve_input_collinear: false,
412412
output_direction: ContourDirection::CounterClockwise,
413413
preserve_output_collinear: false,
414414
min_output_area: 0,
415-
ocg: true,
415+
ogc: true,
416416
}
417417
}
418418
}

iOverlay/src/float/overlay.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct OverlayOptions<T: FloatNumber> {
3232
pub min_output_area: T,
3333

3434
/// If true, extract OGC-valid shapes.
35-
pub ocg: bool,
35+
pub ogc: bool,
3636

3737
/// If true, the result will be cleaned from precision-related issues
3838
/// such as duplicate or nearly identical points. Especially useful for `f32` coordinates.
@@ -329,7 +329,7 @@ impl<T: FloatNumber> Default for OverlayOptions<T> {
329329
output_direction: ContourDirection::CounterClockwise,
330330
preserve_output_collinear: false,
331331
min_output_area: T::from_float(0.0),
332-
ocg: false,
332+
ogc: false,
333333
clean_result,
334334
}
335335
}
@@ -342,7 +342,7 @@ impl<T: FloatNumber> OverlayOptions<T> {
342342
output_direction: self.output_direction,
343343
preserve_output_collinear: self.preserve_output_collinear,
344344
min_output_area: adapter.sqr_float_to_int(self.min_output_area),
345-
ocg: self.ocg,
345+
ogc: self.ogc,
346346
}
347347
}
348348

@@ -352,19 +352,19 @@ impl<T: FloatNumber> OverlayOptions<T> {
352352
output_direction: self.output_direction,
353353
preserve_output_collinear: self.preserve_output_collinear,
354354
min_output_area: 0,
355-
ocg: self.ocg,
355+
ogc: self.ogc,
356356
}
357357
}
358358

359-
pub fn ocg() -> Self {
359+
pub fn ogc() -> Self {
360360
// f32 precision is not enough to cover i32
361361
let clean_result = T::bit_width() <= 32;
362362
Self {
363363
preserve_input_collinear: false,
364364
output_direction: ContourDirection::CounterClockwise,
365365
preserve_output_collinear: false,
366366
min_output_area: T::from_float(0.0),
367-
ocg: true,
367+
ogc: true,
368368
clean_result,
369369
}
370370
}

iOverlay/tests/direction_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ mod tests {
2121
output_direction: ContourDirection::CounterClockwise,
2222
preserve_output_collinear: false,
2323
min_output_area: 0,
24-
ocg: false,
24+
ogc: false,
2525
};
2626

2727
let op1 = IntOverlayOptions {
2828
preserve_input_collinear: false,
2929
output_direction: ContourDirection::Clockwise,
3030
preserve_output_collinear: false,
3131
min_output_area: 0,
32-
ocg: false,
32+
ogc: false,
3333
};
3434

3535
let r0 = &path.simplify(FillRule::NonZero, op0)[0][0];
@@ -61,15 +61,15 @@ mod tests {
6161
output_direction: ContourDirection::CounterClockwise,
6262
preserve_output_collinear: false,
6363
min_output_area: 0,
64-
ocg: false,
64+
ogc: false,
6565
};
6666

6767
let op1 = IntOverlayOptions {
6868
preserve_input_collinear: false,
6969
output_direction: ContourDirection::Clockwise,
7070
preserve_output_collinear: false,
7171
min_output_area: 0,
72-
ocg: false,
72+
ogc: false,
7373
};
7474

7575
let r0 = &path.simplify(FillRule::NonZero, op0)[0];

iOverlay/tests/float_overlay_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ mod tests {
682682
output_direction: ContourDirection::CounterClockwise,
683683
preserve_output_collinear: false,
684684
min_output_area: 0.0,
685-
ocg: false,
685+
ogc: false,
686686
clean_result: false,
687687
};
688688

iOverlay/tests/ocg_tests.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ mod tests {
3333
let mut overlay = Overlay::with_contours_custom(
3434
&subj_paths,
3535
&clip_paths,
36-
IntOverlayOptions::ocg(),
36+
IntOverlayOptions::ogc(),
3737
Default::default(),
3838
);
3939

@@ -74,7 +74,7 @@ mod tests {
7474
let mut overlay = Overlay::with_contours_custom(
7575
&subj_paths,
7676
&clip_paths,
77-
IntOverlayOptions::ocg(),
77+
IntOverlayOptions::ogc(),
7878
Default::default(),
7979
);
8080

@@ -124,7 +124,7 @@ mod tests {
124124
let mut overlay = Overlay::with_contours_custom(
125125
&subj_paths,
126126
&clip_paths,
127-
IntOverlayOptions::ocg(),
127+
IntOverlayOptions::ogc(),
128128
Default::default(),
129129
);
130130

@@ -204,7 +204,7 @@ mod tests {
204204
let mut overlay = Overlay::with_contours_custom(
205205
&subj_paths,
206206
&[],
207-
IntOverlayOptions::ocg(),
207+
IntOverlayOptions::ogc(),
208208
Default::default(),
209209
);
210210

@@ -269,7 +269,7 @@ mod tests {
269269
let mut overlay = Overlay::with_contours_custom(
270270
&subj_paths,
271271
&[],
272-
IntOverlayOptions::ocg(),
272+
IntOverlayOptions::ogc(),
273273
Default::default(),
274274
);
275275

iOverlay/tests/overlay_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod tests {
2222
output_direction: ContourDirection::Clockwise,
2323
preserve_output_collinear: false,
2424
min_output_area: 0,
25-
ocg: false,
25+
ogc: false,
2626
};
2727

2828
fn overlay(test: &BooleanTest, options: IntOverlayOptions, solver: Solver) -> Overlay {

0 commit comments

Comments
 (0)