Coder Social home page Coder Social logo

radmesh's Introduction

radmesh

ADMesh is a library for processing triangulated solid meshes. Currently, ADMesh only reads the STL file format that is used for rapid prototyping applications, although it can write STL, VRML, OFF, and DXF files. Those are bindings for Ruby.

You'll need the ADMesh C library in version 0.98.x.

Usage

require 'radmesh'

# load an STL file
stl = RADMesh::STL.new 'file.stl'

# observe the available methods
p stl.methods

# read the stats
p stl.stats

# see how many facets are there
p stl.size

# walk the facets
stl.each_facet do |facet|
  # get the normal
  p facet[:normal]
  # walk the vertices
  facet[:vertex].each do |vertex|
    # read the coordinates
    p vertex[:x]
    p vertex[:y]
    p vertex[:z]
  end
end

# manipulate the mesh
stl.rotate! :x, 90
stl.scale! 0.5

# repair the mesh
stl.repair!

# and save it
stl.write_binary 'block2.stl'

You can generate the full documentation with yard or see it online on RubyDoc.info.

radmesh's People

Contributors

hroncok avatar jirutka avatar oriolbcn avatar

Watchers

 avatar  avatar

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.