meshcut


Namemeshcut JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/julienr/meshcut
SummaryUtilities to slice 3D triangular meshes.
upload_time2022-01-08 12:35:40
maintainer
docs_urlNone
authorJulien Rebetez
requires_python
license
keywords mesh slice cross-section 3d triangular
VCS
bugtrack_url
requirements pytest flake8
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ========================================================
meshcut - Python utilities to slice 3D triangular meshes
========================================================

.. image:: https://github.com/julienr/meshcut/actions/workflows/checks.yml/badge.svg?branch=master
   :target: https://github.com/julienr/meshcut/actions

A python library to compute the planar cross-section of a 3D mesh.

Given a 3D mesh and a cut plane, this computes a (set of) polyline(s) that
results from cutting the mesh with the plane.

Requires python and numpy. Mayavi is used for visualisation in the examples.

Usage
=====
Run the examples with ::

    python3 examples/0_cross_section.py

Given ::

    In [17]: verts
    Out[17]:
    array([[ 1.6315   , -0.1505   ,  0.       ],
           [ 1.6376   , -0.1516   ,  0.       ],
           [ 1.6493   , -0.1518   ,  0.       ],
           ...,
           [ 1.62088  , -0.0263264, -0.0716966],
           [ 1.63381  , -0.0500889,  0.0726852],
           [ 1.63381  , -0.0500889, -0.0726852]])

    In [20]: faces
    Out[20]:
    array([[1530, 1337, 1338],
           [4549, 4725, 4548],
           [2940, 2950, 3787],
           ...,
           [3107, 3438, 3439],
           [2263, 2281, 2262],
           [3116, 3119, 4171]])

    In [21]: meshcut.cross_section(verts, faces, plane_orig=(1.2, -0.125, 0),
       ....:                       plane_normal=(1, 0, 0))
    Out[21]:
    [array([[  1.20000000e+00,  -1.28957692e-01,  -1.02180769e-01],
            [  1.20000000e+00,  -1.37182869e-01,  -8.06541833e-02],
            [  1.20000000e+00,  -1.36863816e-01,  -6.95125000e-02],


.. image:: screenshot.png
   :width: 50%


Thanks
======
Thanks to @superzanti for the STL use case and the sphere model.

Authors
=======
Julien Rebetez



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/julienr/meshcut",
    "name": "meshcut",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "mesh,slice,cross-section,3D,triangular",
    "author": "Julien Rebetez",
    "author_email": "julien@fhtagn.net",
    "download_url": "https://files.pythonhosted.org/packages/1d/31/5e38fa16d2f305fbcaff40dac1cd1f6a218b550488ba1abae438bbbb7522/meshcut-0.3.0.tar.gz",
    "platform": "",
    "description": "========================================================\nmeshcut - Python utilities to slice 3D triangular meshes\n========================================================\n\n.. image:: https://github.com/julienr/meshcut/actions/workflows/checks.yml/badge.svg?branch=master\n   :target: https://github.com/julienr/meshcut/actions\n\nA python library to compute the planar cross-section of a 3D mesh.\n\nGiven a 3D mesh and a cut plane, this computes a (set of) polyline(s) that\nresults from cutting the mesh with the plane.\n\nRequires python and numpy. Mayavi is used for visualisation in the examples.\n\nUsage\n=====\nRun the examples with ::\n\n    python3 examples/0_cross_section.py\n\nGiven ::\n\n    In [17]: verts\n    Out[17]:\n    array([[ 1.6315   , -0.1505   ,  0.       ],\n           [ 1.6376   , -0.1516   ,  0.       ],\n           [ 1.6493   , -0.1518   ,  0.       ],\n           ...,\n           [ 1.62088  , -0.0263264, -0.0716966],\n           [ 1.63381  , -0.0500889,  0.0726852],\n           [ 1.63381  , -0.0500889, -0.0726852]])\n\n    In [20]: faces\n    Out[20]:\n    array([[1530, 1337, 1338],\n           [4549, 4725, 4548],\n           [2940, 2950, 3787],\n           ...,\n           [3107, 3438, 3439],\n           [2263, 2281, 2262],\n           [3116, 3119, 4171]])\n\n    In [21]: meshcut.cross_section(verts, faces, plane_orig=(1.2, -0.125, 0),\n       ....:                       plane_normal=(1, 0, 0))\n    Out[21]:\n    [array([[  1.20000000e+00,  -1.28957692e-01,  -1.02180769e-01],\n            [  1.20000000e+00,  -1.37182869e-01,  -8.06541833e-02],\n            [  1.20000000e+00,  -1.36863816e-01,  -6.95125000e-02],\n\n\n.. image:: screenshot.png\n   :width: 50%\n\n\nThanks\n======\nThanks to @superzanti for the STL use case and the sphere model.\n\nAuthors\n=======\nJulien Rebetez\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Utilities to slice 3D triangular meshes.",
    "version": "0.3.0",
    "split_keywords": [
        "mesh",
        "slice",
        "cross-section",
        "3d",
        "triangular"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "783099713e13e6b0fc69e82ff546ea67028224083ed66410ca026f54919262b2",
                "md5": "5192dd093e3851f4ebcf191cb3ab4914",
                "sha256": "c9134fdffb6e635cfbfd6bc9f59c8b456f4492f68b6b1431dfc37f9a5ca986dc"
            },
            "downloads": -1,
            "filename": "meshcut-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5192dd093e3851f4ebcf191cb3ab4914",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6959,
            "upload_time": "2022-01-08T12:35:38",
            "upload_time_iso_8601": "2022-01-08T12:35:38.914710Z",
            "url": "https://files.pythonhosted.org/packages/78/30/99713e13e6b0fc69e82ff546ea67028224083ed66410ca026f54919262b2/meshcut-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1d315e38fa16d2f305fbcaff40dac1cd1f6a218b550488ba1abae438bbbb7522",
                "md5": "fc98225d2a9b0e3f611b38bca0e45bf1",
                "sha256": "c07b5ceac38ecd13987cf20aadc099dcfcf7103856ddff7cfd87fa9f05057f21"
            },
            "downloads": -1,
            "filename": "meshcut-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fc98225d2a9b0e3f611b38bca0e45bf1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6940,
            "upload_time": "2022-01-08T12:35:40",
            "upload_time_iso_8601": "2022-01-08T12:35:40.599622Z",
            "url": "https://files.pythonhosted.org/packages/1d/31/5e38fa16d2f305fbcaff40dac1cd1f6a218b550488ba1abae438bbbb7522/meshcut-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-01-08 12:35:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "julienr",
    "github_project": "meshcut",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "6.2.5"
                ]
            ]
        },
        {
            "name": "flake8",
            "specs": [
                [
                    "==",
                    "4.0.1"
                ]
            ]
        }
    ],
    "lcname": "meshcut"
}
        
Elapsed time: 0.03616s