Name | lib3mf JSON |
Version |
2.3.2.post1
JSON |
| download |
home_page | None |
Summary | lib3mf is an implementation of the 3D Manufacturing Format file standard |
upload_time | 2025-02-23 08:35:20 |
maintainer | None |
docs_url | None |
author | None |
requires_python | None |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# lib3mf
[![Build Status]](https://github.com/3MFConsortium/lib3mf/workflows/Build/badge.svg?branch=release%2F2.3.2)
[](https://readthedocs.org/projects/lib3mf)
[]()
[]()
[](LICENSE)
[](https://codecov.io/gh/3MFConsortium/lib3mf)
lib3mf is a C++ implementation of the 3D Manufacturing Format file standard.
It provides 3MF reading and writing capabilities, as well as conversion and validation tools for input and output data.
lib3mf runs on Windows, Linux and MacOS and offers a clean and easy-to-use API in
[various programming languages](https://lib3mf.readthedocs.io/en/latest/#api-documentation)
to speed up the development and keep integration costs at a minimum.
As 3MF shall become an universal 3D Printing standard, its quick adoption is very important.
This library shall lower all barriers of adoption to any possible user, let it be software
providers, hardware providers, service providers or middleware tools.
The specification can be downloaded at
[http://3mf.io/specification/](http://3mf.io/specification/).
## Example (Create Cube)
```python
import lib3mf
from lib3mf import get_wrapper
# Get version
def get_version(wrapper):
major, minor, micro = wrapper.GetLibraryVersion()
print("Lib3MF version: {:d}.{:d}.{:d}".format(major, minor, micro), end="")
hasInfo, prereleaseinfo = wrapper.GetPrereleaseInformation()
if hasInfo:
print("-" + prereleaseinfo, end="")
hasInfo, buildinfo = wrapper.GetBuildInformation()
if hasInfo:
print("+" + buildinfo, end="")
print("")
# Create vertex in a mesh
def create_vertex(_mesh, x, y, z):
position = lib3mf.Position()
position.Coordinates[0] = float(x)
position.Coordinates[1] = float(y)
position.Coordinates[2] = float(z)
_mesh.AddVertex(position)
return position
# Add triangle in a mesh
def add_triangle(_mesh, p1, p2, p3):
triangle = lib3mf.Triangle()
triangle.Indices[0] = p1
triangle.Indices[1] = p2
triangle.Indices[2] = p3
_mesh.AddTriangle(triangle)
return triangle
# Get a wrapper object
wrapper = get_wrapper()
# Check version always
get_version(wrapper)
# Create a model
model = wrapper.CreateModel()
mesh_object = model.AddMeshObject()
mesh_object.SetName("Box")
# Define the size of the cube
fSizeX, fSizeY, fSizeZ = 100.0, 200.0, 300.0
# Create vertices
vertices = [
create_vertex(mesh_object, 0, 0, 0),
create_vertex(mesh_object, fSizeX, 0, 0),
create_vertex(mesh_object, fSizeX, fSizeY, 0),
create_vertex(mesh_object, 0, fSizeY, 0),
create_vertex(mesh_object, 0, 0, fSizeZ),
create_vertex(mesh_object, fSizeX, 0, fSizeZ),
create_vertex(mesh_object, fSizeX, fSizeY, fSizeZ),
create_vertex(mesh_object, 0, fSizeY, fSizeZ)
]
# Define triangles by vertices indices
triangle_indices = [
(2, 1, 0), (0, 3, 2), (4, 5, 6), (6, 7, 4),
(0, 1, 5), (5, 4, 0), (2, 3, 7), (7, 6, 2),
(1, 2, 6), (6, 5, 1), (3, 0, 4), (4, 7, 3)
]
# Create triangles
triangles = []
for v0, v1, v2 in triangle_indices:
triangles.append(add_triangle(mesh_object, v0, v1, v2))
# Set geometry to the mesh object after creating vertices and triangles
mesh_object.SetGeometry(vertices, triangles)
# Add build item with an identity transform
model.AddBuildItem(mesh_object, wrapper.GetIdentityTransform())
# Save the model to a 3MF file
writer = model.QueryWriter("3mf")
writer.WriteToFile("cube.3mf")
```
## Documentation
lib3mf's documentation is available on https://lib3mf.readthedocs.io.
## Obtaining lib3mf
Simply download the precompiled binary SDK https://github.com/3MFConsortium/lib3mf/releases.
## Using lib3mf
Allthough the different language bindings are kept as similar as possible,
the usage of lib3mf still depends your programming language.
You are best-off starting with one of the examples distributed in the [SDK](https://github.com/3MFConsortium/lib3mf/releases) or with this [minimal example in C++](SDK/Examples/CppDynamic/Source/ExtractInfo.cpp).
## Contributing
lib3mf is an open source project and supported by the [3MF Consortium](https://3mf.io/).
Contributions are welcome and we are always looking for people that improve the implementation of the specification and extensions of 3MF. Have a look at the [contributor's guide](CONTRIBUTING.md) for details.
This page also contains a section about building lib3mf from source or obtaining nightly snapshot builds.
## Licenses and third party code
lib3mf is released under the [BSD license](LICENSE). The library contains code of the following [third parties](SDK/Credits.txt):
1. libzip 1.10.1, https://libzip.org/license/
2. zlib 1.3.1, http://www.zlib.net/zlib_license.html
3. cpp-base64 2.rc.08, https://github.com/ReneNyffenegger/cpp-base64/blob/master/LICENSE
4. fast-float v6.0.0, https://github.com/fastfloat/fast_float/tree/v6.0.0?tab=License-3-ov-file
In addition, the automated tests of lib3mf make uses of LibReSSL 3.8.2, [License](https://github.com/libressl/openbsd/blob/master/src/lib/libssl/LICENSE) and googletest 1.14.0 [License](https://github.com/google/googletest/blob/main/LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "lib3mf",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": null,
"platform": null,
"description": "# lib3mf\n\n[![Build Status]](https://github.com/3MFConsortium/lib3mf/workflows/Build/badge.svg?branch=release%2F2.3.2)\n[](https://readthedocs.org/projects/lib3mf)\n[]()\n[]()\n[](LICENSE)\n[](https://codecov.io/gh/3MFConsortium/lib3mf)\n\nlib3mf is a C++ implementation of the 3D Manufacturing Format file standard.\n\nIt provides 3MF reading and writing capabilities, as well as conversion and validation tools for input and output data.\nlib3mf runs on Windows, Linux and MacOS and offers a clean and easy-to-use API in\n[various programming languages](https://lib3mf.readthedocs.io/en/latest/#api-documentation)\nto speed up the development and keep integration costs at a minimum.\n\nAs 3MF shall become an universal 3D Printing standard, its quick adoption is very important. \nThis library shall lower all barriers of adoption to any possible user, let it be software \nproviders, hardware providers, service providers or middleware tools.\n\nThe specification can be downloaded at\n[http://3mf.io/specification/](http://3mf.io/specification/).\n\n\n\n\n## Example (Create Cube)\n\n```python\nimport lib3mf\nfrom lib3mf import get_wrapper\n\n# Get version\ndef get_version(wrapper):\n major, minor, micro = wrapper.GetLibraryVersion()\n print(\"Lib3MF version: {:d}.{:d}.{:d}\".format(major, minor, micro), end=\"\")\n hasInfo, prereleaseinfo = wrapper.GetPrereleaseInformation()\n if hasInfo:\n print(\"-\" + prereleaseinfo, end=\"\")\n hasInfo, buildinfo = wrapper.GetBuildInformation()\n if hasInfo:\n print(\"+\" + buildinfo, end=\"\")\n print(\"\")\n\n\n# Create vertex in a mesh\ndef create_vertex(_mesh, x, y, z):\n position = lib3mf.Position()\n position.Coordinates[0] = float(x)\n position.Coordinates[1] = float(y)\n position.Coordinates[2] = float(z)\n _mesh.AddVertex(position)\n return position\n\n\n# Add triangle in a mesh\ndef add_triangle(_mesh, p1, p2, p3):\n triangle = lib3mf.Triangle()\n triangle.Indices[0] = p1\n triangle.Indices[1] = p2\n triangle.Indices[2] = p3\n _mesh.AddTriangle(triangle)\n return triangle\n\n\n# Get a wrapper object\nwrapper = get_wrapper()\n\n# Check version always\nget_version(wrapper)\n\n# Create a model\nmodel = wrapper.CreateModel()\nmesh_object = model.AddMeshObject()\nmesh_object.SetName(\"Box\")\n\n# Define the size of the cube\nfSizeX, fSizeY, fSizeZ = 100.0, 200.0, 300.0\n\n# Create vertices\nvertices = [\n create_vertex(mesh_object, 0, 0, 0),\n create_vertex(mesh_object, fSizeX, 0, 0),\n create_vertex(mesh_object, fSizeX, fSizeY, 0),\n create_vertex(mesh_object, 0, fSizeY, 0),\n create_vertex(mesh_object, 0, 0, fSizeZ),\n create_vertex(mesh_object, fSizeX, 0, fSizeZ),\n create_vertex(mesh_object, fSizeX, fSizeY, fSizeZ),\n create_vertex(mesh_object, 0, fSizeY, fSizeZ)\n]\n\n# Define triangles by vertices indices\ntriangle_indices = [\n (2, 1, 0), (0, 3, 2), (4, 5, 6), (6, 7, 4),\n (0, 1, 5), (5, 4, 0), (2, 3, 7), (7, 6, 2),\n (1, 2, 6), (6, 5, 1), (3, 0, 4), (4, 7, 3)\n]\n\n# Create triangles\ntriangles = []\nfor v0, v1, v2 in triangle_indices:\n triangles.append(add_triangle(mesh_object, v0, v1, v2))\n\n# Set geometry to the mesh object after creating vertices and triangles\nmesh_object.SetGeometry(vertices, triangles)\n\n# Add build item with an identity transform\nmodel.AddBuildItem(mesh_object, wrapper.GetIdentityTransform())\n\n# Save the model to a 3MF file\nwriter = model.QueryWriter(\"3mf\")\nwriter.WriteToFile(\"cube.3mf\")\n```\n\n## Documentation\nlib3mf's documentation is available on https://lib3mf.readthedocs.io.\n\n## Obtaining lib3mf\nSimply download the precompiled binary SDK https://github.com/3MFConsortium/lib3mf/releases.\n\n## Using lib3mf\nAllthough the different language bindings are kept as similar as possible,\nthe usage of lib3mf still depends your programming language.\n\nYou are best-off starting with one of the examples distributed in the [SDK](https://github.com/3MFConsortium/lib3mf/releases) or with this [minimal example in C++](SDK/Examples/CppDynamic/Source/ExtractInfo.cpp).\n\n## Contributing\nlib3mf is an open source project and supported by the [3MF Consortium](https://3mf.io/).\n\nContributions are welcome and we are always looking for people that improve the implementation of the specification and extensions of 3MF. Have a look at the [contributor's guide](CONTRIBUTING.md) for details.\nThis page also contains a section about building lib3mf from source or obtaining nightly snapshot builds.\n\n## Licenses and third party code\nlib3mf is released under the [BSD license](LICENSE). The library contains code of the following [third parties](SDK/Credits.txt):\n1. libzip 1.10.1, https://libzip.org/license/\n2. zlib 1.3.1, http://www.zlib.net/zlib_license.html\n3. cpp-base64 2.rc.08, https://github.com/ReneNyffenegger/cpp-base64/blob/master/LICENSE\n4. fast-float v6.0.0, https://github.com/fastfloat/fast_float/tree/v6.0.0?tab=License-3-ov-file\n\nIn addition, the automated tests of lib3mf make uses of LibReSSL 3.8.2, [License](https://github.com/libressl/openbsd/blob/master/src/lib/libssl/LICENSE) and googletest 1.14.0 [License](https://github.com/google/googletest/blob/main/LICENSE). \n",
"bugtrack_url": null,
"license": null,
"summary": "lib3mf is an implementation of the 3D Manufacturing Format file standard",
"version": "2.3.2.post1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1d705aba4bad093b0c884018446c352385c61adcf33ccd93f12ed20bd50a9a29",
"md5": "4962d237764c66524d257826833c35f0",
"sha256": "103ab81a276c1f8a7af7542d9cd1b052130b539c7e878822dd50519fd10a4c1c"
},
"downloads": -1,
"filename": "lib3mf-2.3.2.post1-py3-none-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "4962d237764c66524d257826833c35f0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1485483,
"upload_time": "2025-02-23T08:35:20",
"upload_time_iso_8601": "2025-02-23T08:35:20.747000Z",
"url": "https://files.pythonhosted.org/packages/1d/70/5aba4bad093b0c884018446c352385c61adcf33ccd93f12ed20bd50a9a29/lib3mf-2.3.2.post1-py3-none-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2f65e1ff1c3285407759122fef2a46e298ed9dc0d83befe4a61c83ce62334497",
"md5": "9a046b1f86ccf8427a615a0406a7ed13",
"sha256": "ec7eb40fbfea4b15720a3a6850cbb65466b041a3914fe5b2a75006524dc219a7"
},
"downloads": -1,
"filename": "lib3mf-2.3.2.post1-py3-none-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "9a046b1f86ccf8427a615a0406a7ed13",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1009289,
"upload_time": "2025-02-23T08:35:22",
"upload_time_iso_8601": "2025-02-23T08:35:22.738833Z",
"url": "https://files.pythonhosted.org/packages/2f/65/e1ff1c3285407759122fef2a46e298ed9dc0d83befe4a61c83ce62334497/lib3mf-2.3.2.post1-py3-none-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d650a4225f44f040337ac8773cfb94125f13903435662529cb7951e45497f800",
"md5": "d75c9fdcb5fc653de3a92affd473e087",
"sha256": "1d134b5a1f9e5d938858ef20f15de469d681ce92cdcc6f5f86a1c21c7a89524f"
},
"downloads": -1,
"filename": "lib3mf-2.3.2.post1-py3-none-win_amd64.whl",
"has_sig": false,
"md5_digest": "d75c9fdcb5fc653de3a92affd473e087",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 571050,
"upload_time": "2025-02-23T08:35:23",
"upload_time_iso_8601": "2025-02-23T08:35:23.857405Z",
"url": "https://files.pythonhosted.org/packages/d6/50/a4225f44f040337ac8773cfb94125f13903435662529cb7951e45497f800/lib3mf-2.3.2.post1-py3-none-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-23 08:35:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lib3mf"
}