Merge remote-tracking branch 'origin/master' into scintillaeditor

Conflicts:
	src/PlatformUtils.cc
master
Marius Kintel 2014-07-22 14:48:45 -04:00
commit af8c3ee9d1
184 changed files with 345 additions and 239 deletions

View File

@ -32,7 +32,7 @@ before_script:
- base64 --decode --ignore-garbage ~/.ssh/openscad_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
script: ./scripts/travis-ci.sh
script: if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then ./scripts/travis-ci.sh ; fi
env:
global:
@ -75,4 +75,15 @@ env:
- secure: "JsOTX5JsRAY3zyKa/5yYkd48Nejt9CAEraXVpN1NDW25jJmsOynyW5d2WYazJ1H0x1oR6Fhc4gstNxaj1MNh/gVM9O3UM2tyFnSxDY6fZnEGWaf17ln4dqi3KHXWU7h2Gdg1ah19NS0nWytooW6VcEXmk+cYSheTqyfc5gK7Sdo="
- secure: "mMc9MyopIjvzpDg3eN6owSmr2PI58JiPnlLhMNvOWW9axUzup5tthfqM+tvR/AqdLQSSMUC9JXwwQK0d543Q4YyoQ0jwVY2RT56VdEywxD5+yWRfXD+ANlJhdQWmlPVc3KsavKYmfQPBLbwe0nyhtQTWGeAgKTYvYT+k1/PD4rg="
- secure: "X7KDSiSOR3XcePJgTXNzwE1wU285yFsxB7crMLskD08wU8xdRqS8NL+1++/Lju6pypOkospI2AYH1JAJ7JK3Sx5QYM4MxgRJcrMHiTMirN3cm3KzkWUuv3iEZNJ7q6ANi5oFfHh3k0D4JhCEnA1ICTDPdq+r9+mOvgkrly8V0Dw="
# scan.coverity token
- secure: "CGHkiv3Aki3HF2xiNPbPEqB66Xcz8HrdhSpFYjQFqHsrseIXOmZGLaIdnkwCqoIHUMFVtqGVGSxRhhrSOrAq+uOgc6Wyst8u6ThN3HhRbvQgF2v7XvtGsTiAObxLvj5V91gqQwHxWPHf948Cm12QQgmEd+dbhyjPWsmVMDb4gNk="
addons:
coverity_scan:
project:
name: "openscad/openscad"
description: "The Programmers Solid 3D CAD Modeller"
notification_email: torsten.paul@gmx.de
build_command_prepend: qmake
build_command: make
branch_pattern: coverity_scan

View File

@ -1,4 +1,5 @@
[![Travis CI](https://api.travis-ci.org/openscad/openscad.png)](https://travis-ci.org/openscad/openscad)
[![Coverity Status](https://scan.coverity.com/projects/2510/badge.svg)](https://scan.coverity.com/projects/2510)
# What is OpenSCAD?
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=openscad&url=http://openscad.org&title=OpenSCAD&language=&tags=github&category=software)

View File

@ -292,6 +292,7 @@ src/FontCache.h \
src/system-gl.h \
src/stl-utils.h \
src/boost-utils.h \
src/LibraryInfo.h \
src/svg.h \
\
src/lodepng.h \
@ -351,6 +352,7 @@ SOURCES += src/version_check.cc \
src/stl-utils.cc \
src/boost-utils.cc \
src/PlatformUtils.cc \
src/LibraryInfo.cc \
\
src/nodedumper.cc \
src/traverser.cc \

View File

@ -9,6 +9,11 @@ CGAL_Nef_polyhedron::CGAL_Nef_polyhedron(CGAL_Nef_polyhedron3 *p)
if (p) p3.reset(p);
}
// Copy constructor
CGAL_Nef_polyhedron::CGAL_Nef_polyhedron(const CGAL_Nef_polyhedron &src)
{
if (src.p3) this->p3.reset(new CGAL_Nef_polyhedron3(*src.p3));
}
CGAL_Nef_polyhedron& CGAL_Nef_polyhedron::operator+=(const CGAL_Nef_polyhedron &other)
{
@ -79,12 +84,46 @@ PolySet *CGAL_Nef_polyhedron::convertToPolyset() const
return ps;
}
/*!
Deep copy
*/
CGAL_Nef_polyhedron *CGAL_Nef_polyhedron::copy() const
void CGAL_Nef_polyhedron::resize(Vector3d newsize,
const Eigen::Matrix<bool,3,1> &autosize)
{
CGAL_Nef_polyhedron *copy = new CGAL_Nef_polyhedron(*this);
if (copy->p3) copy->p3.reset(new CGAL_Nef_polyhedron3(*copy->p3));
return copy;
// Based on resize() in Giles Bathgate's RapCAD (but not exactly)
if (this->isEmpty()) return;
CGAL_Iso_cuboid_3 bb = CGALUtils::boundingBox(*this->p3);
std::vector<NT3> scale, bbox_size;
for (unsigned int i=0;i<3;i++) {
scale.push_back(NT3(1));
bbox_size.push_back(bb.max_coord(i) - bb.min_coord(i));
}
int newsizemax_index = 0;
for (unsigned int i=0;i<this->getDimension();i++) {
if (newsize[i]) {
if (bbox_size[i] == NT3(0)) {
PRINT("WARNING: Resize in direction normal to flat object is not implemented");
return;
}
else {
scale[i] = NT3(newsize[i]) / bbox_size[i];
}
if (newsize[i] > newsize[newsizemax_index]) newsizemax_index = i;
}
}
NT3 autoscale = NT3(1);
if (newsize[newsizemax_index] != 0) {
autoscale = NT3(newsize[newsizemax_index]) / bbox_size[newsizemax_index];
}
for (unsigned int i=0;i<this->getDimension();i++) {
if (autosize[i] && newsize[i]==0) scale[i] = autoscale;
}
Eigen::Matrix4d t;
t << CGAL::to_double(scale[0]), 0, 0, 0,
0, CGAL::to_double(scale[1]), 0, 0,
0, 0, CGAL::to_double(scale[2]), 0,
0, 0, 0, 1;
this->transform(Transform3d(t));
}

View File

@ -10,6 +10,7 @@ class CGAL_Nef_polyhedron : public Geometry
{
public:
CGAL_Nef_polyhedron(CGAL_Nef_polyhedron3 *p = NULL);
CGAL_Nef_polyhedron(const CGAL_Nef_polyhedron &src);
~CGAL_Nef_polyhedron() {}
virtual size_t memsize() const;
@ -19,14 +20,16 @@ public:
virtual unsigned int getDimension() const { return 3; }
// Empty means it is a geometric node which has zero area/volume
virtual bool isEmpty() const { return !p3; }
virtual Geometry *copy() const { return new CGAL_Nef_polyhedron(*this); }
void reset() { p3.reset(); }
CGAL_Nef_polyhedron &operator+=(const CGAL_Nef_polyhedron &other);
CGAL_Nef_polyhedron &operator*=(const CGAL_Nef_polyhedron &other);
CGAL_Nef_polyhedron &operator-=(const CGAL_Nef_polyhedron &other);
CGAL_Nef_polyhedron &minkowski(const CGAL_Nef_polyhedron &other);
CGAL_Nef_polyhedron *copy() const;
class PolySet *convertToPolyset() const;
void transform( const Transform3d &matrix );
void resize(Vector3d newsize, const Eigen::Matrix<bool,3,1> &autosize);
shared_ptr<CGAL_Nef_polyhedron3> p3;
};

View File

@ -15,6 +15,7 @@ Camera::Camera(enum CameraType camtype) :
}
pixel_width = RenderSettings::inst()->img_width;
pixel_height = RenderSettings::inst()->img_height;
autocenter = false;
}
void Camera::setup(std::vector<double> params)
@ -57,6 +58,12 @@ void Camera::viewAll(const BoundingBox &bbox, float scalefactor)
this->eye = this->center - Vector3d(1,1,-0.5);
}
if (this->autocenter) {
// autocenter = point camera at the center of the bounding box.
this->object_trans = -bbox.center(); // for Gimbal cam
this->center = bbox.center(); // for Vector cam
}
switch (this->projection) {
case Camera::ORTHOGONAL:
this->height = bbox.diagonal().norm();

View File

@ -42,14 +42,20 @@ public:
Eigen::Vector3d object_rot;
double viewer_distance;
// Perspective settings
// Perspective settings
double fov; // Field of view
// Orthographic settings
// Orthographic settings
double height; // world-space height of viewport
// true if camera should try to view everything in a given
// bounding box.
bool viewall;
// true if camera should point at center of bounding box
// (normally it points at 0,0,0 or at given coordinates)
bool autocenter;
unsigned int pixel_width;
unsigned int pixel_height;
};

View File

@ -21,6 +21,7 @@ public:
virtual std::string dump() const = 0;
virtual unsigned int getDimension() const = 0;
virtual bool isEmpty() const = 0;
virtual Geometry *copy() const = 0;
unsigned int getConvexity() const { return convexity; }
void setConvexity(int c) { this->convexity = c; }

View File

@ -161,53 +161,6 @@ Geometry *GeometryEvaluator::applyHull3D(const AbstractNode &node)
return NULL;
}
void GeometryEvaluator::applyResize3D(CGAL_Nef_polyhedron &N,
const Vector3d &newsize,
const Eigen::Matrix<bool,3,1> &autosize)
{
// Based on resize() in Giles Bathgate's RapCAD (but not exactly)
if (N.isEmpty()) return;
CGAL_Iso_cuboid_3 bb = CGALUtils::boundingBox(*N.p3);
std::vector<NT3> scale, bbox_size;
for (unsigned int i=0;i<3;i++) {
scale.push_back(NT3(1));
bbox_size.push_back(bb.max_coord(i) - bb.min_coord(i));
}
int newsizemax_index = 0;
for (unsigned int i=0;i<N.getDimension();i++) {
if (newsize[i]) {
if (bbox_size[i] == NT3(0)) {
PRINT("WARNING: Resize in direction normal to flat object is not implemented");
return;
}
else {
scale[i] = NT3(newsize[i]) / bbox_size[i];
}
if (newsize[i] > newsize[newsizemax_index]) newsizemax_index = i;
}
}
NT3 autoscale = NT3(1);
if (newsize[newsizemax_index] != 0) {
autoscale = NT3(newsize[newsizemax_index]) / bbox_size[newsizemax_index];
}
for (unsigned int i=0;i<N.getDimension();i++) {
if (autosize[i] && newsize[i]==0) scale[i] = autoscale;
}
Eigen::Matrix4d t;
t << CGAL::to_double(scale[0]), 0, 0, 0,
0, CGAL::to_double(scale[1]), 0, 0,
0, 0, CGAL::to_double(scale[2]), 0,
0, 0, 0, 1;
N.transform(Transform3d(t));
return;
}
Polygon2d *GeometryEvaluator::applyMinkowski2D(const AbstractNode &node)
{
std::vector<const Polygon2d *> children = collectChildren2D(node);
@ -457,7 +410,7 @@ Response GeometryEvaluator::visit(State &state, const RenderNode &node)
else if (shared_ptr<const CGAL_Nef_polyhedron> N = dynamic_pointer_cast<const CGAL_Nef_polyhedron>(geom)) {
// If we got a const object, make a copy
shared_ptr<CGAL_Nef_polyhedron> newN;
if (res.isConst()) newN.reset(N->copy());
if (res.isConst()) newN.reset((CGAL_Nef_polyhedron*)N->copy());
else newN = dynamic_pointer_cast<CGAL_Nef_polyhedron>(res.ptr());
newN->setConvexity(node.convexity);
geom = newN;
@ -594,7 +547,7 @@ Response GeometryEvaluator::visit(State &state, const TransformNode &node)
assert(N);
// If we got a const object, make a copy
shared_ptr<CGAL_Nef_polyhedron> newN;
if (res.isConst()) newN.reset(N->copy());
if (res.isConst()) newN.reset((CGAL_Nef_polyhedron*)N->copy());
else newN = dynamic_pointer_cast<CGAL_Nef_polyhedron>(res.ptr());
newN->transform(node.matrix);
geom = newN;
@ -1005,40 +958,31 @@ Response GeometryEvaluator::visit(State &state, const CgaladvNode &node)
case RESIZE: {
ResultObject res = applyToChildren(node, OPENSCAD_UNION);
geom = res.constptr();
shared_ptr<const CGAL_Nef_polyhedron> N = dynamic_pointer_cast<const CGAL_Nef_polyhedron>(res.constptr());
if (N) {
if (geom) {
shared_ptr<Geometry> editablegeom;
// If we got a const object, make a copy
shared_ptr<CGAL_Nef_polyhedron> newN;
if (res.isConst()) newN.reset(N->copy());
else newN = dynamic_pointer_cast<CGAL_Nef_polyhedron>(res.ptr());
applyResize3D(*newN, node.newsize, node.autosize);
geom = newN;
}
else {
shared_ptr<const Polygon2d> poly = dynamic_pointer_cast<const Polygon2d>(res.constptr());
if (poly) {
// If we got a const object, make a copy
shared_ptr<Polygon2d> newpoly;
if (res.isConst()) newpoly.reset(new Polygon2d(*poly));
else newpoly = dynamic_pointer_cast<Polygon2d>(res.ptr());
if (res.isConst()) editablegeom.reset(geom->copy());
else editablegeom = res.ptr();
geom = editablegeom;
newpoly->resize(Vector2d(node.newsize[0], node.newsize[1]),
Eigen::Matrix<bool,2,1>(node.autosize[0], node.autosize[1]));
shared_ptr<CGAL_Nef_polyhedron> N = dynamic_pointer_cast<CGAL_Nef_polyhedron>(editablegeom);
if (N) {
N->resize(node.newsize, node.autosize);
}
else {
shared_ptr<const PolySet> ps = dynamic_pointer_cast<const PolySet>(res.constptr());
if (ps) {
// If we got a const object, make a copy
shared_ptr<PolySet> newps;
if (res.isConst()) newps.reset(new PolySet(*ps));
else newps = dynamic_pointer_cast<PolySet>(res.ptr());
newps->resize(node.newsize, node.autosize);
geom = newps;
shared_ptr<Polygon2d> poly = dynamic_pointer_cast<Polygon2d>(editablegeom);
if (poly) {
poly->resize(Vector2d(node.newsize[0], node.newsize[1]),
Eigen::Matrix<bool,2,1>(node.autosize[0], node.autosize[1]));
}
else {
assert(false);
shared_ptr<PolySet> ps = dynamic_pointer_cast<PolySet>(editablegeom);
if (ps) {
ps->resize(node.newsize, node.autosize);
}
else {
assert(false);
}
}
}
}

108
src/LibraryInfo.cc Normal file
View File

@ -0,0 +1,108 @@
#include "LibraryInfo.h"
#include <glib.h>
#include <vector>
#ifdef USE_SCINTILLA_EDITOR
#include <Qsci/qsciglobal.h>
#endif
#include "version_check.h"
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#ifdef ENABLE_CGAL
#include "cgal.h"
#include <boost/algorithm/string.hpp>
#if defined(__GNUG__)
#define GCC_INT_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 )
#if GCC_INT_VERSION > 40600 || defined(__clang__)
#include <cxxabi.h>
#define __openscad_info_demangle__ 1
#endif // GCC_INT_VERSION
#endif // GNUG
#endif // ENABLE_CGAL
extern std::vector<std::string> librarypath;
extern std::vector<std::string> fontpath;
std::string LibraryInfo::info()
{
std::stringstream s;
#if defined(__GNUG__) && !defined(__clang__)
std::string compiler_info( "GCC " + std::string(TOSTRING(__VERSION__)) );
#elif defined(_MSC_VER)
std::string compiler_info( "MSVC " + std::string(TOSTRING(_MSC_FULL_VER)) );
#elif defined(__clang__)
std::string compiler_info( "Clang " + std::string(TOSTRING(__clang_version__)) );
#else
std::string compiler_info( "unknown compiler" );
#endif
#if defined( __MINGW64__ )
std::string mingwstatus("MingW64");
#elif defined( __MINGW32__ )
std::string mingwstatus("MingW32");
#else
std::string mingwstatus("No");
#endif
#ifndef OPENCSG_VERSION_STRING
#define OPENCSG_VERSION_STRING "unknown, <1.3.2"
#endif
#ifdef QT_VERSION
std::string qtVersion = qVersion();
#else
std::string qtVersion = "Qt disabled - Commandline Test Version";
#endif
#ifdef ENABLE_CGAL
std::string cgal_3d_kernel = typeid(CGAL_Kernel3).name();
std::string cgal_2d_kernel = typeid(CGAL_Kernel2).name();
std::string cgal_2d_kernelEx = typeid(CGAL_ExactKernel2).name();
#if defined(__openscad_info_demangle__)
int status;
cgal_3d_kernel = std::string( abi::__cxa_demangle( cgal_3d_kernel.c_str(), 0, 0, &status ) );
cgal_2d_kernel = std::string( abi::__cxa_demangle( cgal_2d_kernel.c_str(), 0, 0, &status ) );
cgal_2d_kernelEx = std::string( abi::__cxa_demangle( cgal_2d_kernelEx.c_str(), 0, 0, &status ) );
#endif // demangle
boost::replace_all( cgal_3d_kernel, "CGAL::", "" );
boost::replace_all( cgal_2d_kernel, "CGAL::", "" );
boost::replace_all( cgal_2d_kernelEx, "CGAL::", "" );
#else // ENABLE_CGAL
std::string cgal_3d_kernel = "";
std::string cgal_2d_kernel = "";
std::string cgal_2d_kernelEx = "";
#endif // ENABLE_CGAL
const char *env_path = getenv("OPENSCADPATH");
const char *env_font_path = getenv("OPENSCAD_FONT_PATH");
s << "OpenSCAD Version: " << TOSTRING(OPENSCAD_VERSION)
<< "\nCompiler, build date: " << compiler_info << ", " << __DATE__
<< "\nBoost version: " << BOOST_LIB_VERSION
<< "\nEigen version: " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION
<< "\nCGAL version, kernels: " << TOSTRING(CGAL_VERSION) << ", " << cgal_3d_kernel << ", " << cgal_2d_kernel << ", " << cgal_2d_kernelEx
<< "\nOpenCSG version: " << OPENCSG_VERSION_STRING
<< "\nQt version: " << qtVersion
#ifdef USE_SCINTILLA_EDITOR
<< "\nQScintilla version: " << QSCINTILLA_VERSION_STR
#endif
<< "\nMingW build: " << mingwstatus
<< "\nGLib version: " << GLIB_MAJOR_VERSION << "." << GLIB_MINOR_VERSION << "." << GLIB_MICRO_VERSION
<< "\nOPENSCADPATH: " << (env_path == NULL ? "<not set>" : env_path)
<< "\nOpenSCAD library path:\n";
for (std::vector<std::string>::iterator it = librarypath.begin();it != librarypath.end();it++) {
s << " " << *it << "\n";
}
s << "\nOPENSCAD_FONT_PATH: " << (env_font_path == NULL ? "<not set>" : env_font_path)
<< "\nOpenSCAD font path:\n";
for (std::vector<std::string>::iterator it = fontpath.begin();it != fontpath.end();it++) {
s << " " << *it << "\n";
}
return s.str();
}

7
src/LibraryInfo.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
#include <string>
namespace LibraryInfo {
std::string info();
}

View File

@ -1,5 +1,3 @@
#include <glib.h>
#include "PlatformUtils.h"
#include "boosty.h"
#include <Eigen/Core>
@ -8,7 +6,6 @@
#endif
extern std::vector<std::string> librarypath;
extern std::vector<std::string> fontpath;
bool PlatformUtils::createLibraryPath()
@ -82,102 +79,3 @@ bool PlatformUtils::createBackupPath()
}
return OK;
}
#include "version_check.h"
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#ifdef ENABLE_CGAL
#include "cgal.h"
#include <boost/algorithm/string.hpp>
#if defined(__GNUG__)
#define GCC_INT_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 )
#if GCC_INT_VERSION > 40600 || defined(__clang__)
#include <cxxabi.h>
#define __openscad_info_demangle__ 1
#endif // GCC_INT_VERSION
#endif // GNUG
#endif // ENABLE_CGAL
std::string PlatformUtils::info()
{
std::stringstream s;
#if defined(__GNUG__) && !defined(__clang__)
std::string compiler_info( "GCC " + std::string(TOSTRING(__VERSION__)) );
#elif defined(_MSC_VER)
std::string compiler_info( "MSVC " + std::string(TOSTRING(_MSC_FULL_VER)) );
#elif defined(__clang__)
std::string compiler_info( "Clang " + std::string(TOSTRING(__clang_version__)) );
#else
std::string compiler_info( "unknown compiler" );
#endif
#if defined( __MINGW64__ )
std::string mingwstatus("MingW64");
#elif defined( __MINGW32__ )
std::string mingwstatus("MingW32");
#else
std::string mingwstatus("No");
#endif
#ifndef OPENCSG_VERSION_STRING
#define OPENCSG_VERSION_STRING "unknown, <1.3.2"
#endif
#ifdef QT_VERSION
std::string qtVersion = qVersion();
#else
std::string qtVersion = "Qt disabled - Commandline Test Version";
#endif
#ifdef ENABLE_CGAL
std::string cgal_3d_kernel = typeid(CGAL_Kernel3).name();
std::string cgal_2d_kernel = typeid(CGAL_Kernel2).name();
std::string cgal_2d_kernelEx = typeid(CGAL_ExactKernel2).name();
#if defined(__openscad_info_demangle__)
int status;
cgal_3d_kernel = std::string( abi::__cxa_demangle( cgal_3d_kernel.c_str(), 0, 0, &status ) );
cgal_2d_kernel = std::string( abi::__cxa_demangle( cgal_2d_kernel.c_str(), 0, 0, &status ) );
cgal_2d_kernelEx = std::string( abi::__cxa_demangle( cgal_2d_kernelEx.c_str(), 0, 0, &status ) );
#endif // demangle
boost::replace_all( cgal_3d_kernel, "CGAL::", "" );
boost::replace_all( cgal_2d_kernel, "CGAL::", "" );
boost::replace_all( cgal_2d_kernelEx, "CGAL::", "" );
#else // ENABLE_CGAL
std::string cgal_3d_kernel = "";
std::string cgal_2d_kernel = "";
std::string cgal_2d_kernelEx = "";
#endif // ENABLE_CGAL
const char *env_path = getenv("OPENSCADPATH");
const char *env_font_path = getenv("OPENSCAD_FONT_PATH");
s << "OpenSCAD Version: " << TOSTRING(OPENSCAD_VERSION)
<< "\nCompiler, build date: " << compiler_info << ", " << __DATE__
<< "\nBoost version: " << BOOST_LIB_VERSION
<< "\nEigen version: " << EIGEN_WORLD_VERSION << "." << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION
<< "\nCGAL version, kernels: " << TOSTRING(CGAL_VERSION) << ", " << cgal_3d_kernel << ", " << cgal_2d_kernel << ", " << cgal_2d_kernelEx
<< "\nOpenCSG version: " << OPENCSG_VERSION_STRING
<< "\nQt version: " << qtVersion
#ifdef USE_SCINTILLA_EDITOR
<< "\nQScintilla version: " << QSCINTILLA_VERSION_STR
#endif
<< "\nMingW build: " << mingwstatus
<< "\nGLib version: " << GLIB_MAJOR_VERSION << "." << GLIB_MINOR_VERSION << "." << GLIB_MICRO_VERSION
<< "\nOPENSCADPATH: " << (env_path == NULL ? "<not set>" : env_path)
<< "\nOpenSCAD library path:\n";
for (std::vector<std::string>::iterator it = librarypath.begin();it != librarypath.end();it++) {
s << " " << *it << "\n";
}
s << "\nOPENSCAD_FONT_PATH: " << (env_font_path == NULL ? "<not set>" : env_font_path)
<< "\nOpenSCAD font path:\n";
for (std::vector<std::string>::iterator it = fontpath.begin();it != fontpath.end();it++) {
s << " " << *it << "\n";
}
return s.str();
}

View File

@ -9,7 +9,6 @@ namespace PlatformUtils {
bool createLibraryPath();
std::string backupPath();
bool createBackupPath();
std::string info();
/**
* Single character separating path specifications in a list

View File

@ -19,6 +19,7 @@ public:
virtual std::string dump() const;
virtual unsigned int getDimension() const { return 2; }
virtual bool isEmpty() const;
virtual Geometry *copy() const { return new Polygon2d(*this); }
void addOutline(const Outline2d &outline) { this->theoutlines.push_back(outline); }
class PolySet *tessellate() const;

View File

@ -341,7 +341,7 @@ namespace CGALUtils {
}
// Initialize N with first expected geometric object
if (!N) {
N = chN->copy();
N = new CGAL_Nef_polyhedron(*chN);
continue;
}
@ -420,7 +420,7 @@ namespace CGALUtils {
try {
switch (op) {
case OPENSCAD_UNION:
if (target.isEmpty()) target = *src.copy();
if (target.isEmpty()) target = *new CGAL_Nef_polyhedron(src);
else target += src;
break;
case OPENSCAD_INTERSECTION:

View File

@ -184,7 +184,11 @@ Value Expression::sub_evaluate_list_comprehension(const Context *context) const
if (this->call_funcname == "if") {
if (this->children[0]->evaluate(context)) {
vec.push_back(this->children[1]->evaluate(context));
if (this->children[1]->type == "c") {
return this->children[1]->evaluate(context);
} else {
vec.push_back(this->children[1]->evaluate(context));
}
}
return vec;
} else if (this->call_funcname == "for") {

View File

@ -57,6 +57,7 @@
#include "CocoaUtils.h"
#endif
#include "PlatformUtils.h"
#include "LibraryInfo.h"
#include <QMenu>
#include <QTime>
@ -2291,14 +2292,14 @@ MainWindow::helpManual()
void MainWindow::helpLibrary()
{
QString info( PlatformUtils::info().c_str() );
info += QString( qglview->getRendererInfo().c_str() );
QString info(LibraryInfo::info().c_str());
info += QString(qglview->getRendererInfo().c_str());
if (!this->openglbox) {
this->openglbox = new QMessageBox(QMessageBox::Information,
"OpenGL Info", "OpenSCAD Detailed Library and Build Information",
QMessageBox::Ok, this);
}
this->openglbox->setDetailedText( info );
this->openglbox->setDetailedText(info);
this->openglbox->show();
}

View File

@ -37,6 +37,7 @@
#include "parsersettings.h"
#include "rendersettings.h"
#include "PlatformUtils.h"
#include "LibraryInfo.h"
#include "nodedumper.h"
#include "CocoaUtils.h"
@ -109,6 +110,7 @@ static void help(const char *progname)
"%2%[ --version ] [ --info ] \\\n"
"%2%[ --camera=translatex,y,z,rotx,y,z,dist | \\\n"
"%2% --camera=eyex,y,z,centerx,y,z ] \\\n"
"%2%[ --autocenter ] \\\n"
"%2%[ --viewall ] \\\n"
"%2%[ --imgsize=width,height ] [ --projection=(o)rtho|(p)ersp] \\\n"
"%2%[ --render | --preview[=throwntogether] ] \\\n"
@ -135,7 +137,7 @@ static void version()
static void info()
{
std::cout << PlatformUtils::info() << "\n\n";
std::cout << LibraryInfo::info() << "\n\n";
CsgInfo csgInfo = CsgInfo();
try {
@ -158,7 +160,7 @@ Camera get_camera( po::variables_map vm )
vector<string> strs;
vector<double> cam_parameters;
split(strs, vm["camera"].as<string>(), is_any_of(","));
if ( strs.size() == 6 || strs.size() == 7 ) {
if ( strs.size()==6 || strs.size()==7 ) {
BOOST_FOREACH(string &s, strs)
cam_parameters.push_back(lexical_cast<double>(s));
camera.setup( cam_parameters );
@ -177,6 +179,10 @@ Camera get_camera( po::variables_map vm )
camera.viewall = true;
}
if (vm.count("autocenter")) {
camera.autocenter = true;
}
if (vm.count("projection")) {
string proj = vm["projection"].as<string>();
if (proj=="o" || proj=="ortho" || proj=="orthogonal")
@ -613,6 +619,7 @@ int main(int argc, char **argv)
("preview", po::value<string>(), "if exporting a png image, do an OpenCSG(default) or ThrownTogether preview")
("csglimit", po::value<unsigned int>(), "if exporting a png image, stop rendering at the given number of CSG elements")
("camera", po::value<string>(), "parameters for camera when exporting png")
("autocenter", "adjust camera to look at object center")
("viewall", "adjust camera to fit object")
("imgsize", po::value<string>(), "=width,height for exporting png")
("projection", po::value<string>(), "(o)rtho or (p)erspective when exporting png")

View File

@ -26,6 +26,7 @@ public:
virtual std::string dump() const;
virtual unsigned int getDimension() const { return this->dim; }
virtual bool isEmpty() const { return polygons.size() == 0; }
virtual Geometry *copy() const { return new PolySet(*this); }
size_t numPolygons() const { return polygons.size(); }
void append_poly();

View File

@ -528,7 +528,8 @@ Geometry *PrimitiveNode::createGeometry() const
case SQUARE: {
Polygon2d *p = new Polygon2d();
g = p;
if (this->x > 0 && this->y > 0) {
if (this->x > 0 && this->y > 0 &&
!isinf(this->x) && !isinf(this->y)) {
Vector2d v1(0, 0);
Vector2d v2(this->x, this->y);
if (this->center) {
@ -550,7 +551,7 @@ Geometry *PrimitiveNode::createGeometry() const
case CIRCLE: {
Polygon2d *p = new Polygon2d();
g = p;
if (this->r1 > 0) {
if (this->r1 > 0 && !isinf(this->r1)) {
int fragments = Calc::get_fragments_from_r(this->r1, this->fn, this->fs, this->fa);
Outline2d o;

View File

@ -14,6 +14,8 @@ The extensive #else #endif is to ensure only a single error is printed at
a time, to avoid confusion.
*/
#pragma once
#ifndef OPENSCAD_SKIP_VERSION_CHECK

View File

@ -1,4 +1,5 @@
circle();
circle(1/0);
translate([0,3,0]) circle(1);
translate([5,1,0]) circle(r=3);
translate([0,-1,0]) circle(r=0);

View File

@ -1,4 +1,5 @@
square();
square(1/0);
translate([2,0,0]) square([1,1], true);
translate([4,0,0]) square(size=[1,1], center=true);
translate([6,0,0]) square([0,0], true);

View File

@ -21,3 +21,9 @@ echo([ for(i=a) for(j=i) j ]);
echo([ for(i=a) for(j=i) for(k=j) k ]);
echo([ for(i=a,j=i) j ]);
echo([ for(i=a,j=i,k=j) k ]);
echo([ for (a=[0:1]) a]);
echo([ for (a=[0:1]) if (true) a]);
echo([ for (a=[0:1]) if (true) if (true) a]);
echo([ for (a=[0:1]) for (b=[a:2]) [b,a]]);
echo([ for (a=[0:1]) if (true) for (b=[a:2]) [b,a]]);
echo([ for (a=[0:1]) if (true) if (true) for (b=[a:2]) [b,a]]);

View File

@ -74,7 +74,7 @@ if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../libraries/MCAD/__init__.py)
message(FATAL_ERROR "MCAD not found. You can install from the OpenSCAD root as follows: \n git submodule update --init")
endif()
# NULLGL - Allow us to buidl without OpenGL(TM). run 'cmake .. -DNULLGL=1'
# NULLGL - Allow us to build without OpenGL(TM). run 'cmake .. -DNULLGL=1'
# Most tests will fail, but it can be used for testing/experiments
if(NULLGL)
@ -630,8 +630,8 @@ set(CORE_SOURCES
../src/FontCache.cc
../src/DrawingCallback.cc
../src/FreetypeRenderer.cc
../src/PlatformUtils.cc
../src/lodepng.cpp
../src/PlatformUtils.cc
../src/${PLATFORMUTILS_SOURCE}
${FLEX_OpenSCADlexer_OUTPUTS}
${BISON_OpenSCADparser_OUTPUTS})
@ -639,7 +639,8 @@ set(CORE_SOURCES
set(NOCGAL_SOURCES
../src/builtin.cc
../src/import.cc
../src/export.cc)
../src/export.cc
../src/LibraryInfo.cc)
set(CGAL_SOURCES
${NOCGAL_SOURCES}
@ -678,7 +679,8 @@ set(OFFSCREEN_SOURCES
../src/ThrownTogetherRenderer.cc
../src/renderer.cc
../src/render.cc
../src/OpenCSGRenderer.cc)
../src/OpenCSGRenderer.cc
)
if(NULLGL)
message(STATUS "NULLGL is set. Overriding previous OpenGL(TM) settings")
@ -690,9 +692,7 @@ if(NULLGL)
../src/${OFFSCREEN_IMGUTILS_SOURCE}
../src/imageutils.cc
../src/renderer.cc
../src/render.cc
../src/PlatformUtils.cc
../src/${PLATFORMUTILS_SOURCE} )
../src/render.cc)
endif()
add_library(tests-core STATIC ${CORE_SOURCES})
@ -702,7 +702,7 @@ add_library(tests-common STATIC ${COMMON_SOURCES})
target_link_libraries(tests-common tests-core)
add_library(tests-cgal STATIC ${CGAL_SOURCES})
set_target_properties(tests-cgal PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
set_target_properties(tests-cgal PROPERTIES COMPILE_FLAGS "${ENABLE_OPENCSG_FLAG} -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(tests-cgal tests-common ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_LIBRARIES} ${GMP_LIBRARIES} ${MPFR_LIBRARIES})
#
@ -710,12 +710,13 @@ target_link_libraries(tests-cgal tests-common ${CGAL_LIBRARY} ${CGAL_3RD_PARTY_L
#
if (NOT NULLGL)
add_library(tests-nocgal STATIC ${NOCGAL_SOURCES})
set_target_properties(tests-nocgal PROPERTIES COMPILE_FLAGS ${ENABLE_OPENCSG_FLAG})
target_link_libraries(tests-nocgal tests-common)
else()
message(STATUS "NULLGL: cannot use GL/GLU tessellator. see dxftess.cc")
message(STATUS "NULLGL: non-CGAL tests will use CGAL's tessellator")
add_library(tests-nocgal STATIC ${CGAL_SOURCES})
set_target_properties(tests-nocgal PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
add_library(tests-nocgal STATIC ${NOCGAL_SOURCES})
set_target_properties(tests-nocgal PROPERTIES COMPILE_FLAGS ${ENABLE_OPENCSG_FLAG})
target_link_libraries(tests-nocgal tests-common)
endif()
@ -738,15 +739,15 @@ target_link_libraries(csgtexttest tests-nocgal)
# cgalcachetest
#
add_executable(cgalcachetest cgalcachetest.cc)
set_target_properties(cgalcachetest PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
set_target_properties(cgalcachetest PROPERTIES COMPILE_FLAGS "${ENABLE_OPENCSG_FLAG} -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(cgalcachetest tests-cgal ${GLEW_LIBRARY})
#
# openscad no-qt
#
add_executable(openscad_nogui ../src/openscad.cc)
set_target_properties(openscad_nogui PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -DEIGEN_DONT_ALIGN -DENABLE_CGAL -DENABLE_OPENCSG ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(openscad_nogui tests-offscreen tests-cgal tests-nocgal ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${APP_SERVICES_LIBRARY})
set_target_properties(openscad_nogui PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -DEIGEN_DONT_ALIGN ${ENABLE_OPENCSG_FLAG} -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
target_link_libraries(openscad_nogui tests-offscreen tests-cgal ${GLEW_LIBRARY} ${OPENCSG_LIBRARY} ${APP_SERVICES_LIBRARY})
#
# GUI binary tests
@ -867,6 +868,23 @@ function(add_cmdline_test TESTCMD_BASENAME)
string(REPLACE " " "_" FILE_BASENAME ${FILE_BASENAME}) # Test names cannot include spaces
set(TEST_FULLNAME "${TESTCMD_BASENAME}_${FILE_BASENAME}")
list(FIND DISABLED_TESTS ${TEST_FULLNAME} DISABLED)
# 2d tests should be viewed from the top, not an angle.
set(test_is_2d 0)
foreach(test2d IN LISTS TESTS_2D)
string(REGEX MATCH "${test2d}" match_result ${TEST_FULLNAME})
if( NOT "${match_result}" STREQUAL "" )
#message(STATUS "2d test found: ${TEST_FULLNAME}, ${match_result}")
set(test_is_2d 1)
endif()
endforeach()
set(CAMERA_OPTION "")
if(${test_is_2d} EQUAL 1)
#message(STATUS "${TESTCMD_ARGS}")
set(CAMERA_OPTION "--camera=0,0,100,0,0,0" "--viewall" "--autocenter" "--projection=ortho" "--debug=Camera")
set_test_config(Dimension2 ${TEST_FULLNAME})
endif()
if (${DISABLED} EQUAL -1)
# Handle configurations
@ -886,7 +904,7 @@ function(add_cmdline_test TESTCMD_BASENAME)
set(FILENAME_OPTION -f ${FILE_BASENAME})
endif()
add_test(NAME ${TEST_FULLNAME} ${CONFARG} ${CONFVAL} COMMAND ${PYTHON_EXECUTABLE} ${tests_SOURCE_DIR}/test_cmdline_tool.py --comparator=${COMPARATOR} -c ${ImageMagick_convert_EXECUTABLE} -s ${TESTCMD_SUFFIX} ${EXTRA_OPTIONS} ${TESTNAME_OPTION} ${FILENAME_OPTION} ${TESTCMD_EXE} ${TESTCMD_SCRIPT} "${SCADFILE}" ${TESTCMD_ARGS})
add_test(NAME ${TEST_FULLNAME} ${CONFARG} ${CONFVAL} COMMAND ${PYTHON_EXECUTABLE} ${tests_SOURCE_DIR}/test_cmdline_tool.py --comparator=${COMPARATOR} -c ${ImageMagick_convert_EXECUTABLE} -s ${TESTCMD_SUFFIX} ${EXTRA_OPTIONS} ${TESTNAME_OPTION} ${FILENAME_OPTION} ${TESTCMD_EXE} ${TESTCMD_SCRIPT} "${SCADFILE}" ${CAMERA_OPTION} ${TESTCMD_ARGS} )
set_property(TEST ${TEST_FULLNAME} PROPERTY ENVIRONMENT "${CTEST_ENVIRONMENT}")
endif()
endforeach()
@ -968,6 +986,29 @@ list(APPEND THROWNTOGETHERTEST_FILES ${OPENCSGTEST_FILES})
list(APPEND CGALSTLSANITYTEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/misc/normal-nan.scad)
list(APPEND EXPORT3D_TEST_FILES ${EXAMPLE_FILES})
list(APPEND EXPORT3D_TEST_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/polyhedron-nonplanar-tests.scad )
disable_tests(
# the flat_body is not 3d so dont do 3d-tests on it
stlpngtest_flat_body
offpngtest_flat_body
# these take too long, for little relative gain in testing
stlpngtest_iteration
offpngtest_iteration
stlpngtest_fractal
offpngtest_fractal
)
# mark which tests are 2d (regex match inside add_cmdline_test)
# (note - dont use the offset from examples/Advanced)
list(APPEND TESTS_2D circle control-hull-dimension difference-2d ellipse
flat_body hull2 dxf intersection2 issue585 issue612 lwpolyline2 -arc _arc
minkowski2 multiple-layers offset- polygon* primitive-cut projection-test
render-2d resize-2d scale2D scale2d text-search square font
transform-insert triangle)
set(TEST_CONFIGS ${TEST_CONFIGS} Dimension2)
# FIXME: This test illustrates a weakness in child() combined with modifiers.
# Reenable it when this is improved
disable_tests(opencsgtest_child-background)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1014 B

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 865 B

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 684 B

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -1,5 +1,6 @@
group() {
circle($fn = 0, $fa = 12, $fs = 2, r = 1);
circle($fn = 0, $fa = 12, $fs = 2, r = inf);
multmatrix([[1, 0, 0, 0], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) {
circle($fn = 0, $fa = 12, $fs = 2, r = 1);
}

View File

@ -135,42 +135,48 @@ group() {
}
color([1, 0.752941, 0.796078, 1]) {
multmatrix([[1, 0, 0, 32], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
resize(newsize = [0,0,0], auto = [0,1,0]) {
group() {
difference() {
square(size = [5, 5], center = false);
multmatrix([[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = false);
}
multmatrix([[1, 0, 0, 3], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) {
circle($fn = 10, $fa = 12, $fs = 2, r = 1);
multmatrix([[2.4, 0, 0, 0], [0, 2.4, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
resize(newsize = [0,0,0], auto = [0,1,0]) {
group() {
difference() {
square(size = [5, 5], center = false);
multmatrix([[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = false);
}
multmatrix([[1, 0, 0, 3], [0, 1, 0, 3], [0, 0, 1, 0], [0, 0, 0, 1]]) {
circle($fn = 10, $fa = 12, $fs = 2, r = 1);
}
}
}
}
}
}
multmatrix([[1, 0, 0, 32], [0, 1, 0, 16], [0, 0, 1, 0], [0, 0, 0, 1]]) {
resize(newsize = [0,0,15], auto = [1,1,1]) {
group() {
difference() {
square(size = [5, 5], center = false);
multmatrix([[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = false);
}
multmatrix([[1, 0, 0, 2], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = false);
multmatrix([[2.4, 0, 0, 0], [0, 2.4, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
resize(newsize = [0,0,15], auto = [1,1,1]) {
group() {
difference() {
square(size = [5, 5], center = false);
multmatrix([[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = false);
}
multmatrix([[1, 0, 0, 2], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = false);
}
}
}
}
}
}
multmatrix([[1, 0, 0, 32], [0, 1, 0, 32], [0, 0, 1, 0], [0, 0, 0, 1]]) {
resize(newsize = [0,0,15], auto = [0,0,0]) {
group() {
difference() {
square(size = [5, 5], center = false);
multmatrix([[1, 0, 0, 0], [0, 1, 0, 2.5], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [5, 1], center = false);
multmatrix([[2.4, 0, 0, 0], [0, 2.4, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
resize(newsize = [0,0,15], auto = [0,0,0]) {
group() {
difference() {
square(size = [5, 5], center = false);
multmatrix([[1, 0, 0, 0], [0, 1, 0, 2.5], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [5, 1], center = false);
}
}
}
}

View File

@ -1,5 +1,6 @@
group() {
square(size = [1, 1], center = false);
square(size = [inf, inf], center = false);
multmatrix([[1, 0, 0, 2], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
square(size = [1, 1], center = true);
}

View File

@ -18,3 +18,9 @@ ECHO: [[0, 10], [0, 11], [0, 12], [0, 13], [1, 10], [1, 11], [1, 12], [1, 13], [
ECHO: [0, 10, 0, 11, 0, 12, 0, 13, 1, 10, 1, 11, 1, 12, 1, 13, 2, 10, 2, 11, 2, 12, 2, 13, 3, 10, 3, 11, 3, 12, 3, 13]
ECHO: [[0, 10], [0, 11], [0, 12], [0, 13], [1, 10], [1, 11], [1, 12], [1, 13], [2, 10], [2, 11], [2, 12], [2, 13], [3, 10], [3, 11], [3, 12], [3, 13]]
ECHO: [0, 10, 0, 11, 0, 12, 0, 13, 1, 10, 1, 11, 1, 12, 1, 13, 2, 10, 2, 11, 2, 12, 2, 13, 3, 10, 3, 11, 3, 12, 3, 13]
ECHO: [0, 1]
ECHO: [0, 1]
ECHO: [0, 1]
ECHO: [[0, 0], [1, 0], [2, 0], [1, 1], [2, 1]]
ECHO: [[0, 0], [1, 0], [2, 0], [1, 1], [2, 1]]
ECHO: [[0, 0], [1, 0], [2, 0], [1, 1], [2, 1]]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 506 B

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 962 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Some files were not shown because too many files have changed in this diff Show More