Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe booleans objective #11

Closed
wants to merge 12 commits into from
24 changes: 15 additions & 9 deletions 3MF Boolean operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@



| **Version** | 1.1.0 |
| **Version** | 1.2.0 |
| --- | --- |
| **Status** | Published |
| **Status** | Draft |

## Disclaimer

Expand Down Expand Up @@ -71,17 +71,23 @@ See [the 3MF Core Specification software conformance](https://github.com/3MFCons

# Chapter 1. Overview of Additions

The 3MF Core Specification defines the \<components> element in the \<object> resource as definition of a tree of different objects to form an assembly, with the intent to allow the reuse of model definitions for an efficient encoding. The resultant shape of a \<components> element is the aggregation of each \<component> object element.
The 3MF Core Specification defines the \<components> element in the \<object> resource as definition of a tree of different objects to form an assembly, with the intent to allow the reuse of object definitions for an efficient encoding. The resultant shape of a \<components> element is the aggregation of each \<component> object element.

The [section 4.1 Meshes in the core specification](https://github.com/3MFConsortium/spec_core/blob/1.3.0/3MF%20Core%20Specification.md#41-meshes). defines a \<mesh> element as a basic object shape which is defined by triangles.

This extension defines how to combine different objects into a new type of shape defined as a *booleanshape* object. It is based in Constructive Solid Geometry ([CSG](https://en.wikipedia.org/wiki/Constructive_solid_geometry)).
The primary goal of this Boolean extension is to create new model object shapes by applying a sequence of boolean operations (union, subtract and intersect) with mesh objects to a base object.

However, to limit complexity in the consumer, this spec reduces the CSG scope to an ordered concatenation of boolean shapes (left to right in figure 1.1 below).
Two target use cases, but not restricted to:

* Multiple labelling copies of a base object by a mesh representation of a label shape.
* Repeated patterns defined by meshes applied into a base model. For example, repeated perforations.


This extension defines how to combine different objects into a new type of shape defined as a *booleanshape* object. It defines a simple mechanism to concatenate a series of boolean oparations (left to right in figure 1.1 below) into a base model.

##### Figure 1-1: Concatenating booleans operations.

![CSG binary sequence](images/1.1_Csg_sequence.png)
![Boolean sequence](images/1.1_boolean_sequence.png)

This document describes a new element \<booleanshape> in the \<object> elements choice that specifies a new object type, other than a mesh shape or components. This element is OPTIONAL for producers but MUST be supported by consumers that specify support for the 3MF Boolean Operations Extension.

Expand Down Expand Up @@ -123,7 +129,7 @@ The optional \<booleanshape> element contains one or more \<boolean> elements to

**operation** - The boolean operation to perform. The options for the boolean shapes are the following:

1. *union*. The resulting object shape is defined as the merger of the shapes. The resulting object surface property is defined by the property of the surface property defining the outer surface, as defined by [the 3MF Core Specification overlapping order](https://github.com/3MFConsortium/spec_core/blob/1.2.3/3MF%20Core%20Specification.md#412-overlapping-order)
1. *union*. The resulting object shape is defined as the merger of the shapes. The resulting object surface property is defined by the property of the surface property defining the outer surface. The material and the volumetric properties in the overlapped volume are defined by the ones in last overlapping object in that volume. See [the 3MF Core Specification overlapping order](https://github.com/3MFConsortium/spec_core/blob/1.2.3/3MF%20Core%20Specification.md#412-overlapping-order)

union(base,a,b,c) = base Ս (a Ս b Ս c) = ((base Ս a) Ս b) Ս c

Expand All @@ -139,7 +145,7 @@ The optional \<booleanshape> element contains one or more \<boolean> elements to

**path** - When used in conjunction with [the 3MF Production extension](https://github.com/3MFConsortium/spec_production/blob/master/3MF%20Production%20Extension.md), the "path" attribute references objects in non-root model files. Path is an absolute path to the target model file inside the 3MF container that contains the target object. The use of the path attribute in a \<booleanshape> element is ONLY valid in the root model file.

The following diagrams, from the ***CSG*** Wikipedia, show the three operations:
The following diagrams, from the ***CSG*** Wikipedia, show the three boolean operations defined in this specification:

| ![operation = union](images/Boolean_union.png) | ![operation = difference](images/Boolean_difference.png) | ![operation = intersection](images/Boolean_intersect.png) |
| :---: | :---: | :---: |
Expand Down Expand Up @@ -324,4 +330,4 @@ Wikipedia, the free encyclopedia: Constructive solid geometry https://en.wikiped

**3MF Core Specification references**

See the 3MF Core Specification references https://github.com/3MFConsortium/spec_core/blob/1.2.3/3MF%20Core%20Specification.md#references.
See the 3MF Core Specification references https://github.com/3MFConsortium/spec_core/blob/1.2.3/3MF%20Core%20Specification.md#references.
Binary file modified Examples/booleans_operations.3mf
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

This repository contains the Boolean Operations Extension for the 3MF file standard. This extension is based in Constructive solid geometry ([CSG](https://en.wikipedia.org/wiki/Constructive_solid_geometry))

The 3MF Booleans Operations extension simplifies the CSG tree by flattening it as a CSG sequence:
The 3MF Booleans Operations extension simplifies the CSG tree by flattening it as a boolean sequence:

![CSG binary tree](images/1.1_Csg_sequence.png)
![CSG binary tree](images/1.1_boolean_sequence.png)
File renamed without changes
Loading