Code Monkey home page Code Monkey logo

pymesh's Introduction

Python Mesh Library

Feature

  • Supported format

    • STL(Binary, ASCII)
    • OBJ(Wavefront, no material supported)
  • Transform

    • Translate
    • Rotate
    • Scale
  • Join

  • Analyze

    • Volume
  • Numpy is used for inner calculation so that it runs fast.

Install

pip install pymesh

Requirement

numpy is required.

Usage

Load data

# STL
from pymesh import stl
m = stl.Stl("sample.stl")

# OBJ
from pymesh import obj
m = obj.Obj("sample.obj")

Save data

# STL
m.save_stl("out.stl")

# OBJ
m.save_obj("out.obj")

Create empty data

# STL
m = stl.Stl()

# OBJ
m = obj.Obj()

Transform

# Translate
m.translate_x(10)

# Rotate
m.rotate_y(30)

# Scale
m.scale(1, 2, 1)

# Method chain supported
m.translate_x(10).rotate_y(30).scale(10, 1, 1)

Join

  • Combine multiple mesh data into one mesh
# Join
m.join(another)

Analyze

# Volume
m.get_volume()

Support

  • Python 2.7+ and Python 3 are both supported

LICENSE

MIT License

MISC

This library is inspired by numpy-stl.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.