2009-10-14 16:34:50 +04:00
|
|
|
/*
|
2011-01-21 04:21:09 +03:00
|
|
|
* OpenSCAD (www.openscad.org)
|
|
|
|
* Copyright (C) 2009-2011 Clifford Wolf <clifford@clifford.at> and
|
|
|
|
* Marius Kintel <marius@kintel.net>
|
2009-10-14 16:34:50 +04:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2010-02-01 12:34:18 +03:00
|
|
|
* As a special exception, you have permission to link this program
|
|
|
|
* with the CGAL library and distribute executables, as long as you
|
|
|
|
* follow the requirements of the GNU GPL in regard to all of the
|
|
|
|
* software in the executable aside from CGAL.
|
|
|
|
*
|
2009-10-14 16:34:50 +04:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-03-02 21:22:31 +03:00
|
|
|
#include "importnode.h"
|
|
|
|
|
2010-01-30 07:26:05 +03:00
|
|
|
#include "module.h"
|
|
|
|
#include "polyset.h"
|
2013-04-09 08:28:16 +04:00
|
|
|
#include "evalcontext.h"
|
2010-01-30 07:26:05 +03:00
|
|
|
#include "builtin.h"
|
|
|
|
#include "dxfdata.h"
|
|
|
|
#include "dxftess.h"
|
2009-12-09 17:22:50 +03:00
|
|
|
#include "printutils.h"
|
2013-05-09 14:12:58 +04:00
|
|
|
#include "fileutils.h"
|
2011-09-04 02:03:16 +04:00
|
|
|
#include "handle_dep.h" // handle_dep()
|
2009-10-14 16:34:50 +04:00
|
|
|
|
2011-09-08 00:04:59 +04:00
|
|
|
#ifdef ENABLE_CGAL
|
|
|
|
#include "cgalutils.h"
|
|
|
|
#endif
|
|
|
|
|
2010-01-06 05:35:21 +03:00
|
|
|
#include <sys/types.h>
|
2011-09-08 00:04:59 +04:00
|
|
|
#include <fstream>
|
2010-03-02 21:22:31 +03:00
|
|
|
#include <sstream>
|
2010-03-28 19:57:39 +04:00
|
|
|
#include <assert.h>
|
2011-12-06 07:10:32 +04:00
|
|
|
#include <boost/algorithm/string.hpp>
|
|
|
|
#include <boost/regex.hpp>
|
2011-12-07 01:35:03 +04:00
|
|
|
#include <boost/lexical_cast.hpp>
|
2011-12-06 07:10:32 +04:00
|
|
|
#include <boost/filesystem.hpp>
|
2012-08-19 00:28:36 +04:00
|
|
|
namespace fs = boost::filesystem;
|
2011-09-03 08:10:36 +04:00
|
|
|
#include <boost/assign/std/vector.hpp>
|
|
|
|
using namespace boost::assign; // bring 'operator+=()' into scope
|
2012-01-14 08:02:15 +04:00
|
|
|
#include "boosty.h"
|
2009-10-14 16:34:50 +04:00
|
|
|
|
2013-02-02 19:56:07 +04:00
|
|
|
#include <boost/detail/endian.hpp>
|
|
|
|
#include <boost/cstdint.hpp>
|
|
|
|
|
2009-10-14 16:34:50 +04:00
|
|
|
class ImportModule : public AbstractModule
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
import_type_e type;
|
2011-09-07 02:47:55 +04:00
|
|
|
ImportModule(import_type_e type = TYPE_UNKNOWN) : type(type) { }
|
2013-04-20 01:52:01 +04:00
|
|
|
virtual AbstractNode *instantiate(const Context *ctx, const ModuleInstantiation *inst, const EvalContext *evalctx) const;
|
2009-10-14 16:34:50 +04:00
|
|
|
};
|
|
|
|
|
2013-04-20 01:52:01 +04:00
|
|
|
AbstractNode *ImportModule::instantiate(const Context *ctx, const ModuleInstantiation *inst, const EvalContext *evalctx) const
|
2009-10-14 16:34:50 +04:00
|
|
|
{
|
2013-04-19 02:34:14 +04:00
|
|
|
AssignmentList args;
|
|
|
|
args += Assignment("file", NULL), Assignment("layer", NULL), Assignment("convexity", NULL), Assignment("origin", NULL), Assignment("scale", NULL);
|
2013-04-21 01:24:39 +04:00
|
|
|
args += Assignment("filename",NULL), Assignment("layername", NULL);
|
2009-10-14 16:34:50 +04:00
|
|
|
|
2013-04-19 02:34:14 +04:00
|
|
|
// FIXME: This is broken. Tag as deprecated and fix
|
2010-01-08 06:31:06 +03:00
|
|
|
// Map old argnames to new argnames for compatibility
|
2013-04-19 05:51:46 +04:00
|
|
|
// To fix:
|
|
|
|
// o after c.setVariables()
|
|
|
|
// - if "filename" in evalctx: deprecated-warning && v.set_variable("file", value);
|
|
|
|
// - if "layername" in evalctx: deprecated-warning && v.set_variable("layer", value);
|
2013-04-19 02:34:14 +04:00
|
|
|
#if 0
|
2011-09-03 08:10:36 +04:00
|
|
|
std::vector<std::string> inst_argnames = inst->argnames;
|
|
|
|
for (size_t i=0; i<inst_argnames.size(); i++) {
|
2012-03-28 02:05:00 +04:00
|
|
|
if (inst_argnames[i] == "filename") inst_argnames[i] = "file";
|
|
|
|
if (inst_argnames[i] == "layername") inst_argnames[i] = "layer";
|
2010-01-08 06:31:06 +03:00
|
|
|
}
|
2013-04-19 02:34:14 +04:00
|
|
|
#endif
|
2010-01-08 06:31:06 +03:00
|
|
|
|
2009-10-14 16:34:50 +04:00
|
|
|
Context c(ctx);
|
2013-04-09 08:28:16 +04:00
|
|
|
c.setDocumentPath(evalctx->documentPath());
|
2013-04-19 02:34:14 +04:00
|
|
|
c.setVariables(args, evalctx);
|
2013-04-09 09:04:36 +04:00
|
|
|
#if 0 && DEBUG
|
2013-04-09 08:28:16 +04:00
|
|
|
c.dump(this, inst);
|
|
|
|
#endif
|
2009-10-14 16:34:50 +04:00
|
|
|
|
2011-09-07 02:47:55 +04:00
|
|
|
Value v = c.lookup_variable("file");
|
2013-04-21 01:24:39 +04:00
|
|
|
if (v.isUndefined()) {
|
|
|
|
v = c.lookup_variable("filename");
|
2013-04-27 01:41:41 +04:00
|
|
|
if (!v.isUndefined()) {
|
|
|
|
PRINT("DEPRECATED: filename= is deprecated. Please use file=");
|
|
|
|
}
|
2013-04-21 01:24:39 +04:00
|
|
|
}
|
2013-05-09 14:12:58 +04:00
|
|
|
std::string filename = lookup_file(v.isUndefined() ? "" : v.toString(), inst->path(), ctx->documentPath());
|
2011-09-07 02:47:55 +04:00
|
|
|
import_type_e actualtype = this->type;
|
|
|
|
if (actualtype == TYPE_UNKNOWN) {
|
2012-08-19 00:44:46 +04:00
|
|
|
std::string extraw = boosty::extension_str( fs::path(filename) );
|
2012-01-14 08:02:15 +04:00
|
|
|
std::string ext = boost::algorithm::to_lower_copy( extraw );
|
2011-12-06 07:10:32 +04:00
|
|
|
if (ext == ".stl") actualtype = TYPE_STL;
|
|
|
|
else if (ext == ".off") actualtype = TYPE_OFF;
|
|
|
|
else if (ext == ".dxf") actualtype = TYPE_DXF;
|
2011-09-07 02:47:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
ImportNode *node = new ImportNode(inst, actualtype);
|
|
|
|
|
2012-03-28 02:05:00 +04:00
|
|
|
node->fn = c.lookup_variable("$fn").toDouble();
|
|
|
|
node->fs = c.lookup_variable("$fs").toDouble();
|
|
|
|
node->fa = c.lookup_variable("$fa").toDouble();
|
2010-01-06 05:35:21 +03:00
|
|
|
|
2011-09-07 02:47:55 +04:00
|
|
|
node->filename = filename;
|
2012-03-28 02:05:00 +04:00
|
|
|
Value layerval = c.lookup_variable("layer", true);
|
2013-04-21 01:24:39 +04:00
|
|
|
if (layerval.isUndefined()) {
|
2013-04-27 01:41:41 +04:00
|
|
|
layerval = c.lookup_variable("layername");
|
|
|
|
if (!layerval.isUndefined()) {
|
|
|
|
PRINT("DEPRECATED: layername= is deprecated. Please use layer=");
|
|
|
|
}
|
2013-04-21 01:24:39 +04:00
|
|
|
}
|
2012-03-28 02:05:00 +04:00
|
|
|
node->layername = layerval.isUndefined() ? "" : layerval.toString();
|
|
|
|
node->convexity = c.lookup_variable("convexity", true).toDouble();
|
2009-10-14 16:34:50 +04:00
|
|
|
|
2012-03-28 02:05:00 +04:00
|
|
|
if (node->convexity <= 0) node->convexity = 1;
|
2010-01-06 05:35:21 +03:00
|
|
|
|
|
|
|
Value origin = c.lookup_variable("origin", true);
|
|
|
|
node->origin_x = node->origin_y = 0;
|
2012-03-28 02:05:00 +04:00
|
|
|
origin.getVec2(node->origin_x, node->origin_y);
|
2010-01-06 05:35:21 +03:00
|
|
|
|
2012-03-28 02:05:00 +04:00
|
|
|
node->scale = c.lookup_variable("scale", true).toDouble();
|
2010-01-06 05:35:21 +03:00
|
|
|
|
|
|
|
if (node->scale <= 0)
|
|
|
|
node->scale = 1;
|
|
|
|
|
2009-10-14 16:34:50 +04:00
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2013-02-02 20:53:13 +04:00
|
|
|
#define STL_FACET_NUMBYTES 4*3*4+2
|
|
|
|
// as there is no 'float32_t' standard, we assume the systems 'float'
|
|
|
|
// is a 'binary32' aka 'single' standard IEEE 32-bit floating point type
|
2013-02-02 19:56:07 +04:00
|
|
|
union stl_facet {
|
2013-02-02 20:53:13 +04:00
|
|
|
uint8_t data8[ STL_FACET_NUMBYTES ];
|
2013-02-02 19:56:07 +04:00
|
|
|
uint32_t data32[4*3];
|
|
|
|
struct facet_data {
|
|
|
|
float i, j, k;
|
|
|
|
float x1, y1, z1;
|
|
|
|
float x2, y2, z2;
|
|
|
|
float x3, y3, z3;
|
2013-02-02 20:53:13 +04:00
|
|
|
uint16_t attribute_byte_count;
|
2013-02-02 19:56:07 +04:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
|
|
|
void uint32_byte_swap( uint32_t &x )
|
|
|
|
{
|
2013-03-04 08:10:34 +04:00
|
|
|
#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
|
|
|
|
x = __builtin_bswap32( x );
|
|
|
|
#elif defined(__clang__)
|
2013-02-02 19:56:07 +04:00
|
|
|
x = __builtin_bswap32( x );
|
2013-02-02 20:53:13 +04:00
|
|
|
#elif defined(_MSC_VER)
|
2013-02-02 19:56:07 +04:00
|
|
|
x = _byteswap_ulong( x );
|
2013-02-02 20:53:13 +04:00
|
|
|
#else
|
2013-02-02 19:56:07 +04:00
|
|
|
uint32_t b1 = ( 0x000000FF & x ) << 24;
|
|
|
|
uint32_t b2 = ( 0x0000FF00 & x ) << 8;
|
|
|
|
uint32_t b3 = ( 0x00FF0000 & x ) >> 8;
|
|
|
|
uint32_t b4 = ( 0xFF000000 & x ) >> 24;
|
|
|
|
x = b1 | b2 | b3 | b4;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void read_stl_facet( std::ifstream &f, stl_facet &facet )
|
|
|
|
{
|
2013-02-02 20:53:13 +04:00
|
|
|
f.read( (char*)facet.data8, STL_FACET_NUMBYTES );
|
|
|
|
#ifdef BOOST_BIG_ENDIAN
|
2013-02-02 19:56:07 +04:00
|
|
|
for ( int i = 0; i < 12; i++ ) {
|
2013-02-02 20:53:13 +04:00
|
|
|
uint32_byte_swap( facet.data32[ i ] );
|
2013-02-02 19:56:07 +04:00
|
|
|
}
|
2013-02-02 20:53:13 +04:00
|
|
|
// we ignore attribute byte count
|
|
|
|
#endif
|
2013-02-02 19:56:07 +04:00
|
|
|
}
|
|
|
|
|
2013-03-28 01:50:25 +04:00
|
|
|
Geometry *ImportNode::evaluate_geometry(class PolySetEvaluator *) const
|
2009-10-14 16:34:50 +04:00
|
|
|
{
|
2011-09-08 00:04:59 +04:00
|
|
|
PolySet *p = NULL;
|
2009-10-14 16:34:50 +04:00
|
|
|
|
2010-07-07 02:49:12 +04:00
|
|
|
if (this->type == TYPE_STL)
|
2009-10-14 16:34:50 +04:00
|
|
|
{
|
2012-07-15 23:29:14 +04:00
|
|
|
handle_dep((std::string)this->filename);
|
2013-01-29 02:58:36 +04:00
|
|
|
// Open file and position at the end
|
|
|
|
std::ifstream f(this->filename.c_str(), std::ios::in | std::ios::binary | std::ios::ate);
|
2011-12-07 01:35:03 +04:00
|
|
|
if (!f.good()) {
|
2012-01-25 06:11:12 +04:00
|
|
|
PRINTB("WARNING: Can't open import file '%s'.", this->filename);
|
2009-10-14 17:22:59 +04:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2011-09-08 00:27:29 +04:00
|
|
|
p = new PolySet();
|
2011-12-06 07:10:32 +04:00
|
|
|
|
2011-12-07 01:35:03 +04:00
|
|
|
boost::regex ex_sfe("solid|facet|endloop");
|
|
|
|
boost::regex ex_outer("outer loop");
|
|
|
|
boost::regex ex_vertex("vertex");
|
|
|
|
boost::regex ex_vertices("\\s*vertex\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)");
|
|
|
|
|
2013-01-29 02:58:36 +04:00
|
|
|
bool binary = false;
|
2013-05-26 07:37:26 +04:00
|
|
|
std::streampos file_size = f.tellg();
|
2013-01-29 02:58:36 +04:00
|
|
|
f.seekg(80);
|
|
|
|
if (!f.eof()) {
|
2013-02-02 19:56:07 +04:00
|
|
|
uint32_t facenum = 0;
|
|
|
|
f.read((char *)&facenum, sizeof(uint32_t));
|
2013-02-02 20:53:13 +04:00
|
|
|
#ifdef BOOST_BIG_ENDIAN
|
|
|
|
uint32_byte_swap( facenum );
|
|
|
|
#endif
|
2013-07-28 15:42:35 +04:00
|
|
|
if (file_size == static_cast<std::streamoff>(80 + 4 + 50*facenum)) {
|
|
|
|
binary = true;
|
|
|
|
}
|
2013-01-29 02:58:36 +04:00
|
|
|
}
|
|
|
|
f.seekg(0);
|
|
|
|
|
2011-12-07 01:35:03 +04:00
|
|
|
char data[5];
|
|
|
|
f.read(data, 5);
|
2013-01-29 02:58:36 +04:00
|
|
|
if (!binary && !f.eof() && !memcmp(data, "solid", 5)) {
|
2009-10-14 17:22:59 +04:00
|
|
|
int i = 0;
|
|
|
|
double vdata[3][3];
|
2011-12-07 01:35:03 +04:00
|
|
|
std::string line;
|
|
|
|
std::getline(f, line);
|
|
|
|
while (!f.eof()) {
|
|
|
|
|
|
|
|
std::getline(f, line);
|
|
|
|
boost::trim(line);
|
|
|
|
if (boost::regex_search(line, ex_sfe)) {
|
2009-10-14 17:22:59 +04:00
|
|
|
continue;
|
2011-12-06 07:10:32 +04:00
|
|
|
}
|
2011-12-07 01:35:03 +04:00
|
|
|
if (boost::regex_search(line, ex_outer)) {
|
2009-10-14 17:22:59 +04:00
|
|
|
i = 0;
|
|
|
|
continue;
|
2009-10-14 16:34:50 +04:00
|
|
|
}
|
2011-12-07 01:35:03 +04:00
|
|
|
boost::smatch results;
|
|
|
|
if (boost::regex_search(line, results, ex_vertices)) {
|
|
|
|
try {
|
|
|
|
for (int v=0;v<3;v++) {
|
|
|
|
vdata[i][v] = boost::lexical_cast<double>(results[v+1]);
|
|
|
|
}
|
2009-10-14 17:22:59 +04:00
|
|
|
}
|
2012-10-09 04:49:02 +04:00
|
|
|
catch (const boost::bad_lexical_cast &blc) {
|
2012-01-25 06:11:12 +04:00
|
|
|
PRINTB("WARNING: Can't parse vertex line '%s'.", line);
|
2009-10-14 17:22:59 +04:00
|
|
|
i = 10;
|
2011-12-07 01:35:03 +04:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (++i == 3) {
|
2009-10-14 17:22:59 +04:00
|
|
|
p->append_poly();
|
|
|
|
p->append_vertex(vdata[0][0], vdata[0][1], vdata[0][2]);
|
|
|
|
p->append_vertex(vdata[1][0], vdata[1][1], vdata[1][2]);
|
|
|
|
p->append_vertex(vdata[2][0], vdata[2][1], vdata[2][2]);
|
|
|
|
}
|
2009-10-14 16:34:50 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2009-10-14 17:22:59 +04:00
|
|
|
else
|
|
|
|
{
|
2011-12-24 01:01:19 +04:00
|
|
|
f.ignore(80-5+4);
|
2009-10-14 17:22:59 +04:00
|
|
|
while (1) {
|
2013-02-02 19:56:07 +04:00
|
|
|
stl_facet facet;
|
|
|
|
read_stl_facet( f, facet );
|
|
|
|
if (f.eof()) break;
|
|
|
|
p->append_poly();
|
|
|
|
p->append_vertex(facet.data.x1, facet.data.y1, facet.data.z1);
|
|
|
|
p->append_vertex(facet.data.x2, facet.data.y2, facet.data.z2);
|
|
|
|
p->append_vertex(facet.data.x3, facet.data.y3, facet.data.z3);
|
2009-10-14 17:22:59 +04:00
|
|
|
}
|
|
|
|
}
|
2009-10-14 16:34:50 +04:00
|
|
|
}
|
|
|
|
|
2011-09-07 02:47:55 +04:00
|
|
|
else if (this->type == TYPE_OFF)
|
2009-10-14 16:34:50 +04:00
|
|
|
{
|
2011-09-08 00:04:59 +04:00
|
|
|
#ifdef ENABLE_CGAL
|
|
|
|
CGAL_Polyhedron poly;
|
2012-01-15 21:53:32 +04:00
|
|
|
std::ifstream file(this->filename.c_str(), std::ios::in | std::ios::binary);
|
2013-03-28 20:10:43 +04:00
|
|
|
if (!file.good()) {
|
|
|
|
PRINTB("WARNING: Can't open import file '%s'.", this->filename);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
file >> poly;
|
|
|
|
file.close();
|
|
|
|
|
2013-12-15 03:20:35 +04:00
|
|
|
p = new PolySet();
|
2013-12-15 18:06:45 +04:00
|
|
|
bool err = createPolySetFromPolyhedron(poly, *p);
|
|
|
|
if (err) delete p;
|
2013-03-28 20:10:43 +04:00
|
|
|
}
|
2011-09-08 00:04:59 +04:00
|
|
|
#else
|
2012-01-25 06:11:12 +04:00
|
|
|
PRINT("WARNING: OFF import requires CGAL.");
|
2011-09-08 00:04:59 +04:00
|
|
|
#endif
|
2009-10-14 16:34:50 +04:00
|
|
|
}
|
|
|
|
|
2011-09-07 02:47:55 +04:00
|
|
|
else if (this->type == TYPE_DXF)
|
2010-01-06 05:35:21 +03:00
|
|
|
{
|
2011-09-08 00:04:59 +04:00
|
|
|
p = new PolySet();
|
2011-09-04 00:44:41 +04:00
|
|
|
DxfData dd(this->fn, this->fs, this->fa, this->filename, this->layername, this->origin_x, this->origin_y, this->scale);
|
2010-01-06 05:35:21 +03:00
|
|
|
p->is2d = true;
|
2013-05-10 20:01:50 +04:00
|
|
|
dxf_tesselate(p, dd, 0, Vector2d(1,1), true, false, 0);
|
2011-09-04 00:44:41 +04:00
|
|
|
dxf_border_to_ps(p, dd);
|
2010-01-06 05:35:21 +03:00
|
|
|
}
|
2011-09-07 02:47:55 +04:00
|
|
|
else
|
|
|
|
{
|
2012-01-25 06:11:12 +04:00
|
|
|
PRINTB("ERROR: Unsupported file format while trying to import file '%s'", this->filename);
|
2011-09-07 02:47:55 +04:00
|
|
|
}
|
2010-01-06 05:35:21 +03:00
|
|
|
|
2011-09-08 00:04:59 +04:00
|
|
|
if (p) p->convexity = this->convexity;
|
2009-10-14 16:34:50 +04:00
|
|
|
return p;
|
|
|
|
}
|
|
|
|
|
2010-03-02 21:22:31 +03:00
|
|
|
std::string ImportNode::toString() const
|
|
|
|
{
|
|
|
|
std::stringstream stream;
|
2012-07-15 23:29:14 +04:00
|
|
|
fs::path path((std::string)this->filename);
|
2010-03-02 21:22:31 +03:00
|
|
|
|
2010-08-28 23:21:44 +04:00
|
|
|
stream << this->name();
|
2011-11-07 06:59:40 +04:00
|
|
|
stream << "(file = " << this->filename << ", "
|
|
|
|
"layer = " << QuotedString(this->layername) << ", "
|
2011-11-03 22:38:57 +04:00
|
|
|
"origin = [" << std::dec << this->origin_x << ", " << this->origin_y << "], "
|
2011-09-07 02:47:55 +04:00
|
|
|
"scale = " << this->scale << ", "
|
|
|
|
"convexity = " << this->convexity << ", "
|
2012-07-15 05:57:41 +04:00
|
|
|
"$fn = " << this->fn << ", $fa = " << this->fa << ", $fs = " << this->fs
|
|
|
|
#ifndef OPENSCAD_TESTING
|
|
|
|
// timestamp is needed for caching, but disturbs the test framework
|
|
|
|
<< ", " "timestamp = " << (fs::exists(path) ? fs::last_write_time(path) : 0)
|
|
|
|
#endif
|
|
|
|
<< ")";
|
|
|
|
|
2010-03-02 21:22:31 +03:00
|
|
|
|
|
|
|
return stream.str();
|
|
|
|
}
|
2010-08-28 23:21:44 +04:00
|
|
|
|
|
|
|
std::string ImportNode::name() const
|
|
|
|
{
|
2011-09-07 02:47:55 +04:00
|
|
|
return "import";
|
2010-08-28 23:21:44 +04:00
|
|
|
}
|
2011-09-07 02:47:55 +04:00
|
|
|
|
|
|
|
void register_builtin_import()
|
|
|
|
{
|
2011-11-06 21:37:12 +04:00
|
|
|
Builtins::init("import_stl", new ImportModule(TYPE_STL));
|
|
|
|
Builtins::init("import_off", new ImportModule(TYPE_OFF));
|
|
|
|
Builtins::init("import_dxf", new ImportModule(TYPE_DXF));
|
|
|
|
Builtins::init("import", new ImportModule());
|
2011-09-07 02:47:55 +04:00
|
|
|
}
|