Skip to content

Commit

Permalink
working on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikola Lysenko committed Aug 5, 2012
2 parents 1814efa + 1c5eabc commit ee8ad9d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions LICENSE
@@ -1,3 +1,6 @@

This license applies to all files except for those in ./lib/soap-mod

Copyright (c) 2012 Mikola Lysenko

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand Down
19 changes: 9 additions & 10 deletions README.md
Expand Up @@ -13,7 +13,7 @@



# Introduction #
# About #

This is a node.js library for interfacing with the [ShapeWays](http://www.shapeways.com/) 3D printing service. It allows you to:

Expand Down Expand Up @@ -41,12 +41,8 @@ Here is a trivial example showing how to upload an STL file:

# Install #

Via npm:

npm install shapeways



-------------------------------------------------------

# API #
Expand Down Expand Up @@ -100,7 +96,7 @@ The _upload_ method sends a model to ShapeWays. _options_ is a dictionary conta

When _upload_ completes, it calls __callback__ with either an error code, or else a string encoding the _model_id_ in the ShapeWays database. This _model_id_ can be used with ShapeWays [Add To Cart API](http://www.shapeways.com/tutorials/shoppingcart/index.html) to sell the model.

#### Model Formats ####
#### Models ####

In addition to the above parameters, you also need to specify a model. There are three different ways you can do this:

Expand Down Expand Up @@ -128,7 +124,6 @@ In addition to the above parameters, you also need to specify a model. There ar
* __JSON__

While the above two methods may be sufficient for some purposes, the interchange formats accepted by ShapeWays API are quite cumbersome for applications that process or manipulate 3D geometry in Javascript. To facilitate working with models in Javascript, I added an extra option to directly upload an indexed set of faces using JSON. To do this, you specify an object in the _model_json_ field. For example, here is the option field required to upload a multicolored cube:


conn.upload({
title: 'Test JSON Cube'
Expand Down Expand Up @@ -170,14 +165,18 @@ In addition to the above parameters, you also need to specify a model. There ar
* _face_colors_ : (Optional) An array of colors for each face (must be same length as _faces_)
* _tex_coords_ : (Optional) An array of texture coordinates (must be same length as _verts_)

__Note:__ It is redundant to specify both _face_colors_ and _tex_coords_. If both are present and a texture is specified, _tex_coords_ overrides _face_colors_.


#### Textures ####

You can also specify [textures](http://www.shapeways.com/tutorials/exporting_to_vrml_and_x3d_for_color_printing) to color your models. Note that only VRML and X3D formats currently support this feature.


-------------------------------------------------------


# Legal Stuff

# Legal stuff

ShapeWays is a trademark of ShapeWays Inc. This is of course free software and is provided without any warranty.
This unofficial wrapper was written by Mikola Lysenko, and is not in any way supported by or affiliated with ShapeWays. This package includes a modified version of [node-soap](https://github.com/milewise/node-soap/), with patches to work around some API compatibility problems. Other than the files in lib/soap-mod, this project is covered by the MIT license.

4 changes: 3 additions & 1 deletion lib/models.js
Expand Up @@ -193,7 +193,7 @@ exports.read_model = function(args, cb) {
var mtype = model_types[type]
, has_color = mtype.color && !!args.has_color;

fs.readFile(filename, 'base64', function(err, data) {
fs.readFile(filename, function(err, data) {
if(err) {
cb(err, null);
return;
Expand Down Expand Up @@ -249,6 +249,8 @@ exports.read_model = function(args, cb) {

} else if('texture_filename' in args) {

fs.readFile(args.tex

} else {
//Don't use texture
create_model(null, null, null);
Expand Down

0 comments on commit ee8ad9d

Please sign in to comment.