diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0bc7386 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +# It is used to create am easily distributable and printable PDF +# version of a specification document written in markdown (3MF-style). + +# (outdated) Documentation: +# https://github.com/3MFConsortium/spec_conventions/blob/master/generatePDFs/generatePDFs.md + +on: [pull_request] +name: Build +jobs: + build-linux: + runs-on: ubuntu-20.04 + env: + SPECNAME: "3MF Beam Lattice Extension" + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - run: pip install wheel + - run: pip install grip + - run: ./markdownToPDF/install_wkhtmltopdf.sh + - run: ./markdownToPDF/mdToPDF.sh "$SPECNAME" + - name: Upload PDF + uses: actions/upload-artifact@v2 + with: + name: ${{ env.SPECNAME }}.pdf + path: ${{ env.SPECNAME }}.pdf + + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 47cde33..0000000 --- a/.travis.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2019 3MF Consortium -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: - -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. - -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# Configuration file for Travis CI (https://travis-ci.org) -# It is used to create am easily distributable and printable PDF -# version of a specification document written in markdown (3MF-style). - -# Documentation: -# https://github.com/3MFConsortium/spec_conventions/blob/master/generatePDFs/generatePDFs.md - -dist: xenial -language: python -python: 3.7 - -env: - - SPECNAME="3MF Beam Lattice Extension" -install: - - pip install grip - - ./markdownToPDF/install_wkhtmltopdf.sh - -script: - - ./markdownToPDF/mdToPDF.sh "$SPECNAME" - -deploy: - provider: releases - api_key: '$GITHUB_API_KEY' - file: '${SPECNAME}.pdf' - skip_cleanup: true - draft: true - name: "Snapshot" - body: "This is an autogenerated PDF version of $SPECNAME." - prerelease: true - on: - branch: master diff --git a/3MF Beam Lattice Extension.md b/3MF Beam Lattice Extension.md index 6209bc4..9680744 100644 --- a/3MF Beam Lattice Extension.md +++ b/3MF Beam Lattice Extension.md @@ -12,7 +12,7 @@ -| **Version** | 1.1.0 | +| **Version** | 1.2.0 | | --- | --- | | **Status** | Published | @@ -34,8 +34,8 @@ THESE MATERIALS ARE PROVIDED "AS IS." The contributors expressly disclaim any wa - [Part II. Appendixes](#part-ii-appendixes) * [Appendix A. Glossary](#appendix-a-glossary) * [Appendix B. 3MF XSD Schema](#appendix-b-3mf-xsd-schema) - * [Appendix C. Standard Namespace](#appendix-c-standard-namespace) - * [Appendix D: Example file](#appendix-d-example-file) + * [Appendix C. Standard Namespaces](#appendix-c-standard-namespaces) + * [Appendix D: Example files](#appendix-d-example-files) - [References](#references) # Preface @@ -56,7 +56,7 @@ This extension MUST be used only with Core specification 1.x. See [the 3MF Core Specification conventions](https://github.com/3MFConsortium/spec_core/blob/master/3MF%20Core%20Specification.md#document-conventions). -In this extension specification, as an example, the prefix "b" maps to the xml-namespace "http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02". See [Appendix C. Standard Namespace](#appendix-c-standard-namespace). +In this extension specification, as an example, the prefix "b" maps to the base xml-namespace "http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02", as defined in version 1.1, and the prefix "b2" maps to the xml namespace "http://schemas.microsoft.com/3dmanufacturing/beamlattice/balls/2020/07" defining balls. See [Appendix C. Standard Namespaces](#appendix-c-standard-namespaces). ## Language Notes @@ -80,7 +80,11 @@ In order to find a balance between implementation complexity and capabilities, i While this is meant to be an exact specification of the lattice geometry, and consumers MUST interpret it as such, the intent is also for applications in which editors can use the data structures for efficient interoperability and post processing the geometry in an intermediate step. -A producer using the lattice specification MUST mark the extension as required, as described in the core specification. +This extension specification contains two schemas, one for the beam lattice elements and the other for ball elements. + +A producer using the lattice specification MUST mark the "b" extension as required, as described in the core specification. A producer SHOULD also mark the additional "b2" namespace for balls within beam lattices as a required extension when the 3MF file contains beam lattices with balls. However, for backwards compatibility, the producer SHOULD not mark the "b2" as a required extension when the 3MF file does not contain beam lattices with balls. + +Please refer to the example 3MF file in [Appendix D: Example files](#appendix-d-example-files) for guidance on how to apply namespace prefixes appropriately to elements and attributes associated with this extension. ##### Figure 1-1: Overview of model XML structure of 3MF with beam lattice additions @@ -191,7 +195,7 @@ A beam MAY combine two different capmodes on either vertex. >**Note** : In case of cylinders (i.e. both radii of a beam are equal), the notion of sphere and hemisphere leads to the same geometry. -The unification of all beam and ball geometries of a beamlattice and the triangle mesh will give a well-defined lattice geometry. To guarentee this, all beams MUST be capped prior to the unification process. +The unification of all beam and ball geometries of a beamlattice and the triangle mesh will give a well-defined lattice geometry. To guarantee this, all beams MUST be capped prior to the unification process. Within the beamlattice, the surface properties of the geometry will be given by the unification of the surface properties of the beam elements. In the case of overlapping surface regions, the last beam MUST prevail, analogous to the corresponding overlapping rules of the core specification. @@ -231,8 +235,8 @@ Element **\** | --- | --- | --- | --- | --- | | vindex | **ST\_ResourceIndex** | required | | References a zero-based index into the vertices of this mesh. Defines the vertex that serves as the center for this ball. | | r | **ST\_PositiveNumber** | optional | | The radius of this ball. | -| p | **ST\_ResourceIndex** | optional | | Overrides the beamlattice-level pindex for this sphere. | -| pid | **ST\_ResourceID** | optional | | Overrides the beamlattice-level pid for this beam. | +| p | **ST\_ResourceIndex** | optional | | Overrides the beamlattice-level pindex for this ball. | +| pid | **ST\_ResourceID** | optional | | Overrides the beamlattice-level pid for this ball. | The _ball element_ defines a sphere of a given radius centered at the position of the vertex defined by "vindex". The vertex defined by "vindex" MUST be the end vertex of at least one beam. @@ -305,9 +309,15 @@ See [the 3MF Core Specification glossary](https://github.com/3MFConsortium/spec_ ## Appendix B. 3MF XSD Schema +### A.1. Beam lattice schema + ```xml - + + - - - @@ -369,31 +376,11 @@ See [the 3MF Core Specification glossary](https://github.com/3MFConsortium/spec_ - - - - - - - - - - - - - - - - - - - - @@ -410,22 +397,8 @@ See [the 3MF Core Specification glossary](https://github.com/3MFConsortium/spec_ - - - - - - - - - - - - - - @@ -459,26 +432,122 @@ See [the 3MF Core Specification glossary](https://github.com/3MFConsortium/spec_ - - - ``` +### A.2. Balls schema within beam lattices +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` -## Appendix C. Standard Namespace +## Appendix C. Standard Namespaces BeamLattice [http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02](http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02) -## Appendix D: Example file +BallsWithinBeamLattice [http://schemas.microsoft.com/3dmanufacturing/beamlattice/balls/2020/07](http://schemas.microsoft.com/3dmanufacturing/beamlattice/balls/2020/07) + +## Appendix D: Example files + +### D.1. Beam lattices example ```xml - + @@ -517,6 +586,57 @@ BeamLattice [http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02 ``` +### D.2. Beam lattices with balls example + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + # References See [the 3MF Core Specification references](https://github.com/3MFConsortium/spec_core/blob/master/3MF%20Core%20Specification.md#references). diff --git a/images/ball.png b/images/ball.png index 243af1d..3c01e75 100644 Binary files a/images/ball.png and b/images/ball.png differ diff --git a/images/ballref.png b/images/ballref.png index af95a7c..986606d 100644 Binary files a/images/ballref.png and b/images/ballref.png differ diff --git a/images/balls.png b/images/balls.png index 185edba..bd9baae 100644 Binary files a/images/balls.png and b/images/balls.png differ diff --git a/images/beamlattice.png b/images/beamlattice.png index 9b80bde..332adf6 100644 Binary files a/images/beamlattice.png and b/images/beamlattice.png differ diff --git a/images/beamset.png b/images/beamset.png index 7a0ce77..6915a4a 100644 Binary files a/images/beamset.png and b/images/beamset.png differ diff --git a/images/figure_2-1.png b/images/figure_2-1.png index a879b0c..539f52b 100644 Binary files a/images/figure_2-1.png and b/images/figure_2-1.png differ diff --git a/images/mesh.png b/images/mesh.png index 49360e9..b140af5 100644 Binary files a/images/mesh.png and b/images/mesh.png differ diff --git a/markdownToPDF/mdToPDF.sh b/markdownToPDF/mdToPDF.sh index 331835b..e91cab2 100755 --- a/markdownToPDF/mdToPDF.sh +++ b/markdownToPDF/mdToPDF.sh @@ -23,13 +23,13 @@ #!/bin/bash -mkdir ~/.grip -echo "PASSWORD = '${GITHUB_API_KEY}'" > ~/.grip/settings.py +# mkdir ~/.grip +# echo "PASSWORD = '${GITHUB_API_KEY}'" > ~/.grip/settings.py FILE="$1" TMPFILE="temp.html" -grip "$FILE.md" --export "$FILE.html" +/home/runner/.local/bin/grip "$FILE.md" --export "$FILE.html" sed "s|readme boxed-group clearfix announce instapaper_body md||g" "$FILE.html" > "$TMPFILE" sed -i "s|.md$||g" "$TMPFILE" sed -i 's|