Coder Social home page Coder Social logo

openscad / openscad Goto Github PK

View Code? Open in Web Editor NEW
6.5K 249.0 1.2K 81.27 MB

OpenSCAD - The Programmers Solid 3D CAD Modeller

Home Page: https://www.openscad.org

License: Other

C++ 61.88% OpenSCAD 4.11% NSIS 0.58% Shell 2.88% C 24.21% Makefile 0.02% CSS 0.07% JavaScript 0.52% HTML 0.44% Python 1.40% Objective-C++ 0.11% CMake 2.28% Batchfile 0.01% Lex 0.21% Yacc 0.35% GLSL 0.02% POV-Ray SDL 0.91%
3d-models dxf-files openscad 3d-graphics 3d-printing c-plus-plus qt5 opengl 3d linux

openscad's Introduction

GitHub (master) CircleCI (master) Coverity Scan

Visit our IRC channel

What is OpenSCAD?

OpenSCAD is a software for creating solid 3D CAD objects. It is free software and available for Linux/UNIX, MS Windows and macOS.

Unlike most free software for creating 3D models (such as the famous application Blender), OpenSCAD focuses on the CAD aspects rather than the artistic aspects of 3D modeling. Thus this might be the application you are looking for when you are planning to create 3D models of machine parts but probably not the tool for creating computer-animated movies.

OpenSCAD is not an interactive modeler. Instead it is more like a 3D-compiler that reads a script file that describes the object and renders the 3D model from this script file (see examples below). This gives you, the designer, complete control over the modeling process and enables you to easily change any step in the modeling process or make designs that are defined by configurable parameters.

OpenSCAD provides two main modeling techniques: First there is constructive solid geometry (aka CSG) and second there is extrusion of 2D outlines. As the data exchange format for these 2D outlines Autocad DXF files are used. In addition to 2D paths for extrusion it is also possible to read design parameters from DXF files. Besides DXF files OpenSCAD can read and create 3D models in the STL and OFF file formats.

Contents

Getting started

You can download the latest binaries of OpenSCAD at https://www.openscad.org/downloads.html. Install binaries as you would any other software.

When you open OpenSCAD, you'll see three frames within the window. The left frame is where you'll write code to model 3D objects. The right frame is where you'll see the 3D rendering of your model.

Let's make a tree! Type the following code into the left frame:

cylinder(h = 30, r = 8);

Then render the 3D model by hitting F5. Now you can see a cylinder for the trunk in our tree. Now let's add the bushy/leafy part of the tree represented by a sphere. To do so, we will union a cylinder and a sphere.

union() {
  cylinder(h = 30, r = 8);
  sphere(20);
}

But, it's not quite right! The bushy/leafy are around the base of the tree. We need to move the sphere up the z-axis.

union() {
  cylinder(h = 30, r = 8);
  translate([0, 0, 40]) sphere(20);
}

And that's it! You made your first 3D model! There are other primitive shapes that you can combine with other set operations (union, intersection, difference) and transformations (rotate, scale, translate) to make complex models! Check out all the other language features in the OpenSCAD Manual.

Documentation

Have a look at the OpenSCAD Homepage (https://www.openscad.org/documentation.html) for documentation.

Building OpenSCAD

To build OpenSCAD from source, follow the instructions for the platform applicable to you below.

Prerequisites

To build OpenSCAD, you need some libraries and tools. The version numbers in brackets specify the versions which have been used for development. Other versions may or may not work as well.

If you're using a newer version of Ubuntu, you can install these libraries from aptitude. If you're using Mac, or an older Linux/BSD, there are build scripts that download and compile the libraries from source. Follow the instructions for the platform you're compiling on below.

For the test suite, additional requirements are:

  • Python3 (3.8 -> )

Getting the source code

Install git (https://git-scm.com/) onto your system. Then run a clone:

git clone https://github.com/openscad/openscad.git

This will download the latest sources into a directory named openscad.

To pull the various submodules (incl. the MCAD library), do the following:

cd openscad
git submodule update --init --recursive

Building for macOS

Prerequisites:

  • Xcode
  • automake, libtool, cmake, pkg-config, wget, meson (we recommend installing these using Homebrew)

Install Dependencies:

After building dependencies using one of the following options, follow the instructions in the Compilation section.

  1. From source

    Run the script that sets up the environment variables:

     source scripts/setenv-macos.sh
    

    Then run the script to compile all the dependencies:

     ./scripts/macosx-build-dependencies.sh
    
  2. Homebrew (assumes Homebrew is already installed)

     ./scripts/macosx-build-homebrew.sh
    

Building for Linux/BSD

First, make sure that you have git installed (often packaged as 'git-core' or 'scmgit'). Once you've cloned this git repository, download and install the dependency packages listed above using your system's package manager. A convenience script is provided that can help with this process on some systems:

sudo ./scripts/uni-get-dependencies.sh

After installing dependencies, check their versions. You can run this script to help you:

./scripts/check-dependencies.sh

Take care that you don't have old local copies anywhere (/usr/local/). If all dependencies are present and of a high enough version, skip ahead to the Compilation instructions.

Building for Linux/BSD on systems with older or missing dependencies

If some of your system dependency libraries are missing or old, then you can download and build newer versions into $HOME/openscad_deps by following this process. First, run the script that sets up the environment variables.

source ./scripts/setenv-unibuild.sh

Then run the script to compile all the prerequisite libraries above:

./scripts/uni-build-dependencies.sh

Note that huge dependencies like gcc, qt, or glib2 are not included here, only the smaller ones (boost, CGAL, opencsg, etc). After the build, again check dependencies.

./scripts/check-dependencies.sh

After that, follow the Compilation instructions below.

Building for Windows

OpenSCAD for Windows is usually cross-compiled from Linux. If you wish to attempt an MSVC build on Windows, please see this site: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows

To cross-build, first make sure that you have all necessary dependencies of the MXE project ( listed at https://mxe.cc/#requirements ). Don't install MXE itself, the scripts below will do that for you under $HOME/openscad_deps/mxe

Then get your development tools installed to get GCC. Then after you've cloned this git repository, start a new clean bash shell and run the script that sets up the environment variables.

source ./scripts/setenv-mingw-xbuild.sh 64

Then run the script to download & compile all the prerequisite libraries above:

./scripts/mingw-x-build-dependencies.sh 64

Note that this process can take several hours, and tens of gigabytes of disk space, as it uses the https://mxe.cc system to cross-build many libraries. After it is complete, build OpenSCAD and package it to an installer:

./scripts/release-common.sh mingw64

For a 32-bit Windows cross-build, replace 64 with 32 in the above instructions.

Compilation

First, run mkdir build && cd build && cmake .. -DEXPERIMENTAL=1 to generate a Makefile.

Then run make. Finally, on Linux you might run make install as root.

If you had problems compiling from source, raise a new issue in the issue tracker on the github page.

This site and it's subpages can also be helpful: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_OpenSCAD_from_Sources

Once built, you can run tests with ctest from the build directory.

Note: Both make and ctest accepts a -j N argument for distributing the load over N parallel processes.

Running CI workflows locally

  • Install circleci-cli (you'll need an API key)

    Note: we also use GitHub Workflows, but only to run tests on Windows (which we cross-build for in the Linux-based CircleCI workflows below). Also, act doesn't like our submodule setup anyway.

  • Run the CI jobs

    # When "successful", these will fail to upload at the very end of the workflow.
    circleci local execute --job  openscad-mxe-64bit
    circleci local execute --job  openscad-mxe-32bit
    circleci local execute --job  openscad-appimage-64bit

    Note: openscad-macos can't be built locally.

  • If/when GCC gets randomly killed, give docker more RAM (e.g. 4GB per concurrent image you plan to run)

  • To debug the jobs more interactively, you can go the manual route (inspect .circleci/config.yml to get the actual docker image you need)

    docker run --entrypoint=/bin/bash -it openscad/mxe-x86_64-gui:latest

    Then once you get the console:

    git clone https://github.com/%your username%/openscad.git workspace
    cd workspace
    git checkout %your branch%
    git submodule init
    git submodule update
    
    # Then execute the commands from .circleci/config.yml:
    #    export NUMCPU=2
    #    ...
    #    ./scripts/release-common.sh -snapshot -mingw64 -v "$OPENSCAD_VERSION"

openscad's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openscad's Issues

IGES Export

It would be great to support IGES export.

Masses of debug info

The latest Windows snapshot (2012.02.29) produces a lot of "New module" and file paths in the console window and when run from the command line.

STL exports last F6 state, not current file

Seems that when we are using F5 to update the view, the export STL, that the STL file is from the last time F6 was done.
Should do a new F6 automatically before STL export I think.

str() function leaves in quotation marks "

version 2011.10.29 on Ubuntu 11.10

Example from user manual http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/String_Functions produces a result different to expected result.

Example:
number=2;
echo ("This is ",number,3," and that's it.");
echo (str("This is ",number,3," and that's it."));

Expected Result:
ECHO: "This is ", 2, 3, " and that's it."
ECHO: "This is 23 and that's it."

Result produced:
ECHO: "This is ", 2, 3, " and that's it."
ECHO: ""This is "23" and that's it.""

build system needs to check library versions

the build system should check library versions before compilation.

it should stop the build by default if versions of libraries are lower than versions that have caused bug reports. it should throw a message advising the user to update their libraries.

it should have the option to force-compilation anyway if the user desires.

for CGAL this means 3.9 or newer (as of Feb 2012)
for OpenCSG this means 1.3.2 or newer (as of Feb 2012)

crash from shared_ptr.hpp

I when I am trying to compile I run into this bug(output from terminal).

openscad: /usr/include/boost/smart_ptr/shared_ptr.hpp:424: T* boost::shared_ptr::operator->() const [with T = CSGTerm]: Assertion `px != 0' failed.
Aborted

I am trying to compile SmartMouse1.scad from here...
https://github.com/tesla893/SmartMouse/tree/master/CAD

specifically line 56...
"translate([0,chassisY/2-13.1,0])cube([25,26.1,10]); //back ultra mounts"

when I change the Z value from 10 to something larger, like 20 it crashes.

Let me know if you need anymore info, and thanks!
-Steve

please add commandline option to render design to image

I think it would be usefull to have commandline option that will allow us to non-interactively render scad design to some bitmap image file (also sending image to stdout can be usefull in some cases). note that there should be some way to define angle of view (like ctrl+[0-9] does or exact angle).

THX ;-)

autotab

This is more just wishlisting, but the ability to autotab (as an option) would be nice.
I might be the only one, but I get frustrated when trying to organize my code and having to tab it all out for every new line, instead of it automatically tabbing to the current tab length.

OGLTempContext: Unable to create GL context.

]$ openscad
QGLTempContext: Unable to create GL context.
QGLTempContext: Unable to create GL context.
QGLContext::makeCurrent(): Cannot make invalid context current.

The gui pops up, but no graphics window.

Compiled on Fedora 14 Linux with now obvious errors.
QT version 4.6.1-7

Note from QGLViewer documentation:
QGLViewer ( QGLContext * context,
QWidget * parent = 0,
const QGLWidget * shareWidget = 0,
Qt::WFlags flags = 0
) [explicit]

Same as QGLViewer(), but a QGLContext can be provided so that viewers share GL contexts, even with QGLContext sub-classes (use shareWidget otherwise).

Note:
This constructor is correctly working only with Qt versions greater or equal than 3.2. The provided context is simply ignored otherwise.

Is there some environment variable I need to set? Or is it more serious than that?

Infinite loop in 2D subsystem ?

I ran into weird bug when designing a lasercut enclosure, all the sides of the box are made with the 2D subsystem and for visualization extruded to 3D, this works fine. But when I try to compile just one of the 2D designs alone (for exporting to DXF) it will cause a seemingly infinite loop (I ran out of swapspace at ~20G of memory used by OpenSCAD...), and it's not even the most complex part that triggers this.

This is on Mac, using 2011.12.13 version but I'm fairly sure I ran into same issue with the stable version as well (I switched to devel for a reason).

Code at https://gist.github.com/1492786

Module /Function Parameter Passing By Reference

Would it be possible to pass parameters into modules /functions by reference? Having such a mechanism allows writing modules that can significantly enhance re-usability of components. For example imagine the following:

c = 5; // side c of the triangle
b = 4; // side b of the triangle
a = 3; // side a of the trinagle
r = 1; // radius of round triangle corners
h = 3; // hight of triangle
p = [...]; // Coordinates of corner centers and triangle's center of gravity

// create a triangle with round corners and a 2 mm diameter centered hole in each corner
difference () {
3D_TRIANGLE (s1=a,s2=b,s3=c,hi=h,p_arr=p); // module drawing 3D-triangles with rounded corners
translate (p[0] cylinder (r1=1,r2=1,h=5,center=true); // p[0] got co-ordinate of triangle A - corner
translate (p[1] cylinder (r1=1,r2=1,h=5,center=true); // p[1] got co-ordinate of triangle B - corner
translate (p[2] cylinder (r1=1,r2=1,h=5,center=true); // p[2] got co-ordinate of triangle C - corner
}

Problem when compiling the OpenSCAD.

Hi,

I can not compile the OpenSCAD, because of the following error:

yacc -d -p parser -b parser src/parser.y
yacc: e - line 27 of "src/parser.y", syntax error
%expect 1 /* Expect 1 shift/reduce conflict for ifelse_statement - "dangling
else problem" /
^
make: *
* [parser_yacc.h] Error 1

I've tried the latest version and the version from the github and does not
compile on both.

Anyone have suggestions for solving this problem?

My OS is Gentoo Linux - AMD64

Thanks,

Henrique Dias

MCAD files can't find each other

I'm trying:

include <MCAD/screw.scad>

and I get this error in the console:

WARNING: Can't open input file 'curves.scad'.

If I modify screw.scad and change "include <curves.scad>" to "include <MCAD/curves.scad>" it finds the file successfully, but I don't know if that's right.

64-bit Linux

Exception from cache trimming debug

I'm running a fairly complex file through yesterday's OpenSCAD (git 7ae1f6d ) with debug enabled. I'm getting an exception when Cache::trim in src/cache.h tries to PRINTB a debug printout:

ifdef DEBUG

            PRINTB("Trimming cache: %1% (%d bytes)", *u->keyPtr % u->c);

endif

then /usr/include/boost/format/parsing.hpp throws an exception:
if( !ordered_args) {
if(max_argN >= 0 ) { // dont mix positional with non-positionnal directives
if(exceptions() & io::bad_format_string_bit)
boost::throw_exception(io::bad_format_string(max_argN, 0));
// else do nothing. => positionnal arguments are processed as non-positionnal
}
(the above from Ubuntu 11.04, which appears to be Boost 1.42.0)

My file is 60K and depends on all sorts of DXF and STL inclusions so I can't really include it here. However, this is the backtrace:
http://www.cl.cam.ac.uk/~atm26/ephemeral/20120208-openscad-backtrace.png
and the debugger's idea of the data structures:
http://www.cl.cam.ac.uk/~atm26/ephemeral/20120208-openscad-printb-exception.png

The bit of model that data structure is referring to is:

module alprofile() {
if (render_al_extrusion_shape && !project_upstairs_central_plane)
{
translate([-1.5_cm, -1.5_cm, 0]) polygon(points=[[0_mm,0_mm],[11_mm,0_cm],[11_mm,7.5_mm],[19_mm,7.5_mm],[19_mm,0_cm],[3.0_cm,0_cm],[3.0_cm,1.1_cm],[2.25_cm,1.1_cm],[2.25_cm,1.9_cm],[3.0_cm,1.9_cm],[3.0_cm,3.0_cm],[1.9_cm,3.0_cm],[1.9_cm,2.25_cm],[1.1_cm,2.25_cm],[1.1_cm,3.0_cm],[0_cm,3.0_cm],[0_cm,1.9_cm],[0.75_cm,1.9_cm],[0.75_cm,1.1_cm],[0_cm,1.1_cm]],paths=[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]]);
} else {
translate([-1.5_cm, -1.5_cm, 0]) polygon(points=[[0_cm,0_cm],[3.0_cm,0_cm],[3.0_cm,3.0_cm],[0_cm,3.0_cm]],paths=[[0,1,2,3]]);
}
}

module alextrusion(length) {
linear_extrude(height = length, center = true, convexity = 10, twist = 0)
alprofile();
}

But the error goes away if I comment out selected bits of my model (ie it appears to be related to the complexity of my model as a whole, not a particular section).

If there's some better way I can instrument it to display what's going wrong in that data structure I'm happy to do that (I don't really understand all the C++ structures).

Export (flat cuts) as SVG

OpenSCAD is designed for 3D modeling but you can also use it for some 2D modeling - the only barrier is you cannot export your models to SVG (or another vector file format). The only way is to export DXF and then convert to SVG, but there is no open source tool for this purpose (you can do to some degree with LX-viewer). 2D SVG export may also be useful to export cuts through your 3D-model.

Mac OS X Lion && Intel GPU: Lighting on surface faces goes completely black [$5]

It seems like there are some faces on the sphere that should be shaded instead of being completely black.

https://skitch.com/iamwilhelm/g3k8i/openscad-sphere.scad

This doesn't seem like it's the right behavior, since it seems like there's two light sources, one above and to the left, and one below to the right. Both light sources should be able to cover the currently black square faces.


Did you fix this issue? Go claim the $5 bounty on Bountysource.

Command line argument ignored if file doesn't end in newline

When I have a file where the last character isn't a newline, OpenSCAD ignores the first argument on the command line. Consider the code in the file scad-params.scad:

a_a=false;
b_b=false;
c_c=false;
echo("a=",a_a,"b=",b_b,"c=",c_c);
// end of file

If that has the last byte of the file as 'e' running it gives this:

$ openscad -o foo.dxf -D a_a=1 -D b_b=2 scad-params.scad
ECHO: "a=", false, "b=", 2, "c=", false
CGAL Cache insert: group(); (40 bytes)
CGAL Cache insert: group(){group();} (40 bytes)
Current top level object is not a 2D object.

If the 'e' is followed by a newline, ie the last two bytes are 'e\n', it correctly notices the -D a_a=1 argument:

$ openscad -o foo.dxf -D a_a=1 -D b_b=2 scad-params.scad
ECHO: "a=", 1, "b=", 2, "c=", false
CGAL Cache insert: group(); (40 bytes)
CGAL Cache insert: group(){group();} (40 bytes)
Current top level object is not a 2D object.

I'm running a freshly 'git pull'ed OpenSCAD: commit a15c899, on Ubuntu 11.04, x86.

Backport boost::filesystem code to boost < 1.44

Some of the recent work porting from Qt to boost introduceed a dependency on boost filesystem V3 (which is part of boost 1.44 and later). Since lots of older Linux distributions use older versions of boost, it makes sense to be compatible with these.

Export creates non-manifold STLs [$15]

example: x-end-motor.scad from http://github.com/prusajr/PrusaMendel/

render succeeds, export to STL succeeds, opening the generated STL in openscad (import_stl) succeeds, compile of stl succeeds, render of stl fails with "ERROR: Illegal polygonal object - make sure all polygons are defined with the same winding order."

Feeding the stl to cloud.netfabb.com and saving the result allows openscad to render successfully.

The object looks identical in openscad's 3d view throughout the entire process

Update Feb 2016:

  • issue13c.scad is currently the only failing testcase. The issue is a collapsed volume (two back-to-back triangles.


There is a $15 open bounty on this issue. Add to the bounty at Bountysource.

Abort from CGALEvaluator::evaluateCGALMesh::PolyReducer::add_edges

This:

projection(cut=true)
translate([0,0,193]) rotate([0,90,0])
translate([20,20,122.6])
translate([182,355.6,-9])
translate([63.5,278.8,0])
rotate([0,0,180]) {
translate([9,-90,1.61])
cube([63.5,198.8,40]);
}

causes git 'head' ( 7a4b756 ) to abort:

$ openscad -o /tmp/foo.dxf cgal-abort-t2.scad
CGAL Cache insert: cube(size=[63.5,198.8,40],center=false); (10872 bytes)
CGAL Cache insert: multmatrix([[1,0,0,9],[0,1,0,-90],[0,0,1 (10872 bytes)
CGAL Cache insert: multmatrix([[-1,-1.22461e-16,0,0],[1.224 (10872 bytes)
CGAL Cache insert: multmatrix([[1,0,0,63.5],[0,1,0,278.8],[ (10872 bytes)
CGAL Cache insert: multmatrix([[1,0,0,182],[0,1,0,355.6],[0 (10872 bytes)
CGAL Cache insert: multmatrix([[1,0,0,20],[0,1,0,20],[0,0,1 (10872 bytes)
CGAL Cache insert: multmatrix([[2.22045e-16,0,1,0],[0,1,0,0 (10872 bytes)
CGAL Cache hit: multmatrix([[2.22045e-16,0,1,0],[0,1,0,0 (10872 bytes)
CGAL Cache insert: multmatrix([[1,0,0,0],[0,1,0,0],[0,0,1,1 (10872 bytes)
Aborted

Running this in the debugger, it appears to be from CGALEvaluator::evaluateCGALMesh::PolyReducer::add_edges where there's (src/CGALEvaluator.cc line 454):
if (this->edge_to_poly[std::pair<int,int>(a, b)].first == 0)
this->edge_to_poly[std::pair<int,int>(a, b)].first = pn;
else if (this->edge_to_poly[std::pair<int,int>(a, b)].second == 0)
this->edge_to_poly[std::pair<int,int>(a, b)].second = pn;
else
abort();

I think it might be that the above random selection of translations (distilled down from a very much larger hierarchical model) so happens to have the top of the cube exactly co-incident with the X-Y plane and the projection is getting confused. But I might gently point out that randomly aborting with no explanation isn't the most user-friendly interface ever :)

Is there any way to get a 'backtrace' of errors - 'error with polygon from shape defined on line XXX' so you know which of your hundred objects, which each go through dozens of transformations, is the culprit?

On another point, I tried some of the alternative versions of that code in that function that are #if 0-ed out, but none of them now compile.

Dependency tracking of use'd modules doesn't work

..it's actually not implemented.

TODO:

o Write a test program/script which changes a used module and reevaluates to prove that it doesn't work
o Fix the problem
o Also test with included files
o Think about exotic corner cases (e.g. declaring variables in one file and using it in another)

This has been reported by nop head on at least two occasions.

One particular problem reported also by nop head and which may or may not be related to this is that sometimes, when modules don't update properly, flush caches should fix this problem, but it apparently doesn't. This problem seems to go away when restarting OpenSCAD, so it might be related to having a long-running OpenSCAD session.

bug in handling of child(0) in nested modules (i think)

Hi. I come across this bug:

if i write

module tubify(k=0.1) {
difference() {
child(0);
scale(1.0-j) child(0);
}
}

tubify() cube([5,5,5],center=true);

i get correctly a cube with a cubic hole inside. But if i write

module internal(j=0.1) {
scale(1.0-j) child(0);
}

module tubify(k=0.1) {
difference() {
child(0);
internal(k) child(0);
}
}

tubify() cube([5,5,5],center=true);

i only get a full cube. Why is that behaviour?

Application and system freeze on Windows

After rendering any model (F5 or F6) any attempt to rotate or translate the viewport (using the mouse) causes the application to freeze. It also causes Windows to become completely unresponsive to everything but CTRL + ALT + DELETE, which curiously brings OpenSCAD back to life and allows it to move the viewport. However, the problem occurs again as soon as the viewport is moved. Sometimes only Task Manager can save you from having to do a hard reset.

I'm using Windows 7 Home Premium 64 Bit Service Pack 1. I understand (from my Google searches) that other Windows users have experienced similar problems.

intersection does not always intersect ...

This intersection has a unexpected result in OpenSCAD 2011.06

radius = 100;

intersection(){
  circle(r=radius);
  square([radius,-radius]);
}

some sort oft pattern i discovered here:

[ radius, radius] // works
[ radius,-radius] // fails
[-radius,-radius] // works
[-radius, radius] // fails

hf

current version fails to run & compile

prerequisites / dependencies should be updated: compile and run fails with
symbol lookup error: /usr/local/lib/libopencsg.so.1: undefined symbol: __GLEW_ARB_occlusion_query2

which could be resolved by using libglew1.6 instead of 1.5
[on ubuntu natty 10.4]

grtx

openscad doesn't remember gui settings

Everything I open a .scad file I have to do ctrl-2 to enable the axis view and enable automatic reload and compile.

I would be nice if openscad would at least remember the axis settings

Can't open files from command-line

I thought it would be wise to move this from the mailing list to the issues list so it is not forgotten.

Opening files from the command-line is broken for me now. The OpenSCAD editor is empty instead of being populated with the file. It must have been in one of the last few commits because I know it was working recently. Maybe all that boost filesystem stuff broke it? My tests are on Ubuntu 11.10 64-bit.

I noticed this in the console:
Failed to open file: /media/code/openscad-master/home/brad/Downloads/shell.scad (No such file or directory)

It appears to be appending the path I call openscad from (/media/code/openscad-master) to the path of the file (/home/brad/Downloads/shell.scad)

The combo path does not exist.

version() and version_num() returns 0

In the release build of OpenSCAD, version() and version_num() return 0.
This is due to a bug in version.pri not correctly populating the YEAR/MONTH variables.

Better support 2D models by adding lines

2D laser cutting and CNC is not hyped as much as 3D printing, but it has similar potential. Although OpenSCAD has been designed for 3D modeling, you can also use it to create some flat 2D models, which can be exported as DXF files (I'd prefer an SVG export, but that's another issue).

However there is one problem: There are no simple lines in OpenSCAD! Objects that tough each other are always joined by UNION so you cannot cut them into pieces. Here is an example:

square([10,10]); translate([0,5]) circle(5);

is equivalent to

union() { square([10,10]); translate([0,5]) circle(5); }

and to

group() { square([10,10]); translate([0,5]) circle(5); }

But when you do cutting, you might want to have two pieces:

difference() { square([10,10]); translate([0,5]) circle(5); } // one
translate([0,5]) circle(5); // second

For 2D modeling there should be a command to create unfilled outlines from objects and a command to create unclosed lines (I'd also like bezier to draw Bezier lines but that's another issue). Outlines and lines are closed or unclosed lines in space that can also be unioned and differenced. For 3D models, simple lines should not harm, they can be used as guidelines for visualizing, but just ignored in the STL export. However, for serious 2D models we need simple lines as elements in OpenSCAD and DXF/SVG export.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Size ticks on axes

It would be helpfull if openscad could have ticks on the axes at every 10 units (or similar).

MCAD/involute_gears.scad problem in F5 mode.

I use OpenSCAD 2011.04.27 on Ubuntu.

It renders OK with F6 but F5 appear strange.

See
http://all-technology.com/openscad-F5.png
and
http://all-technology.com/openscad-F6.png

The script I use is:
include <MCAD/involute_gears.scad>;

teeth=11;
dist=150;

translate([dist,dist,0]) rotate([0,90,90]) bevel_gear_pair(gear1_teeth = teeth, gear2_teeth = teeth);
translate([dist,-dist,0]) rotate([0,-90,90]) bevel_gear_pair(gear1_teeth = teeth, gear2_teeth = teeth);
translate([-dist,dist,0]) rotate([0,-90,-90]) bevel_gear_pair(gear1_teeth = teeth, gear2_teeth = teeth);
translate([-dist,-dist,0]) rotate([0,90,-90]) bevel_gear_pair(gear1_teeth = teeth, gear2_teeth = teeth);

Minkowski issues

I just ran into a couple minkowski issues using the latest code.

If I run the following OpenSCAD code:

minkowski() {
union() {
cube([100, 100, 100], center = true);
cube([60, 50, 100]);
}
sphere(2);
}

I get this error in the console:

CGAL error in CGAL_Nef_polyhedron's minkowski operator: CGAL ERROR: assertion violation!
File: /usr/include/CGAL/Convex_decomposition_3/SM_walls.h
Line: 363
Explanation: wrong handle

I get the feeling that this may simply be a situation that the algorithm by minkowski cannot handle, but OpenSCAD should at least give a more user friendly error, right?

If I then change the second cube to "cube([50, 50, 100]);" OpenSCAD handles it just fine. If I change the cube back to the original and compile again OpenSCAD will crash! This only occurs when compiling the good version first. Does it have something to do with the cache?

I'm running 64-bit Linux

regression test should test multiple subsequent renders

there are some problems that only show up when you go in the GUI and try to render a file, open another file, and then render it. this can show up when altering the internal code of the system like the GL rendering ... the regression tests pass, but running in the GUI and loading/reloading files produces errors.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

add search() function

I was in need of a search function similar to lookup but for searching strings and lists for matches and returning the index value(s) matched. I took a stab at it and came up with this builtin_search() in func.cc:

https://github.com/clothbot/openscad/blob/master/src/func.cc

I've been exercising my code with this:

https://github.com/clothbot/openscad/blob/master/testdata/scad/misc/search-tests.scad

I haven't quite got the hang of all the git forking, branching and pull requests across branch boundaries, but the changes to func.cc should be pretty self-contained and clear in any diffs you do.

Please consider pulling it into the master branch. Thanks!

difference() problem with extruded polygon in CGAL (F6) mode

This renders properly with F5, but not with F6. IMHO there are no conflicting verticles, etc...

module pagoda(scale=1, height=1, ratio=2, center=true) {
    scale([scale,scale])
    linear_extrude(height=height, center=center)
    polygon(points=[[-1,1],[1,1],[1*ratio,-1],[-1*ratio,-1]], paths=[[0,1,2,3]]);
}

module male() {
    difference() {
        pagoda(ratio=2, scale=0.9);     
        translate([0,-0.21]) pagoda(ratio=2, scale=0.7, height=1.1);
    }
}

male();

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Compilation finished.
Rendering Polygon Mesh using CGAL...
Number of vertices currently in CGAL cache: 926
Number of objects currently in CGAL cache: 99
Top level object is a 3D object:
Simple: yes
Valid: yes
Vertices: 8
Halfedges: 24
Edges: 12
Halffacets: 12
Facets: 6
Volumes: 2
Total rendering time: 0 hours, 0 minutes, 0 seconds
Rendering finished.

Test for undefined variables

This isn't a bug report as much as it is a feature request / question.

I'm trying to make a module that does rounded corned cylinder that mimics the behavior of cylinder(), where if arg "r" is defined, then it'll overwrite the values of "r1" and "r2"

However, I don't know of a way to test for undefined variables in OpenSCAD. The best I've figured out is something like:

module rounded_cylinder(h, r1, r2, r = -1) {
  if (r != -1) {
    render_rounded_cylinder(h, r1, r2);
  } else {
    render_rounded_clyinder(h, r, r);
  }
}

Is there a better way? Right now, this works because dimensions generally aren't negative with solids. But what if one was defining something like a spline where there might be negative arguments?

I'd like a way to test arguments for whether they're defined or not. If that goes against OpenSCAD philosophy, what's a better way to go about this?

OpenCSG renders with errors on Macbook Air [$5]

When I put in the test case:

intersection() {
sphere(30);
cube(30);
}

It's suppose to show 1/8th of a sphere. However, the display is completely blank and empty. This only happens with intersection and difference. For union, they both show up correctly.

I'm running mac os X 10.7.2. Lion. Are there libraries I need to install or check before I install openSCAD? I suspect I may be missing a library. But if not, then it's a bug with openSCAD.

I will try to compile it from source and see if I have the same issue.


Did you fix this issue? Go claim the $5 bounty on Bountysource.

Feature Request: Progressive display of rendered components

I would love it if I could press F6 and the OpenSCAD render pane would graphically show each element of my model as they are rendered. It would be cool to see my model get built piece by piece, and seeing how long different parts of the design take to render would help discover inefficiencies in the design. Of course, if it would slow down the render much, I immediately rescind my request because rendering is already slow enough.

Thinking long term, maybe OpenSCAD could eventually have step-by-step debug rendering. A user could render one line at a time and see each piece get added. I would find this very helpful to debug issues in the design.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

build should refuse to compile with CGAL < 3.9

this code from chrysn (on the mailing list discussion with Marius, chrysn, Brad, et al) only works in CGAL 3.9, earlier versions have various crashing / assertion errors

minkowski() {
cube(20, center=true);
rotate([20, 30, 40])
difference() {
cube(5, center=true);
cube([1, 1, 10], center=true);
}
}


the instructions on the user manual wiki should be updated as well.

Default font should be mono

I opened up the windows build of openscad with wine for testing and noticed that the default font was "MS Sans Serif". I think the default font should be a mono font to enable the use of spaces for code alignment. Ex.

test_vector = [[0, 0, 0],
                     [0, 1, 1],
                     [1, 0, 0]];

This example will only look exactly aligned with a mono font. Is that a difficult problem to solve?

assigned values aren't accessible by child()

I wrote about this to the mailing list, but noone replied. Maybe it will get more attention here.

I tried doing something like this:

module test() {
    assign(variable=1) child();
}

test() cube(variable);

and found that OpenSCAD complained about not knowing what variable is.
Shouldn't variable be known to the child? Otherwise the assign really isn't doing anything.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Rotation does not perform as described in documentation

I would like to use the feature of rotation around an arbitrary origin as described here:
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#rotate

The optional argument 'v' allows you to set an arbitrary origin about which the object will be rotated.

Example with arbitrary origin.

rotate(a=[0,180,0], [10,10,10]) { ... }

When I tried this example it did not perform as expected. Below is a code example of what I tested and the results I saw:

// initial reference cube
cube(1); 

// sphere representing "arbitrary origin" reference point
translate([10,10,10]) sphere(1, $fn=20); 

// seems to ignore v, and just rotates "a" angle around [0,0,0] origin
rotate(a=[0,180,0], v=[10,10,10]) cube(1); 

// seems to ignore "a" and use the second vector as the rotation angle around [0,0,0] origin
rotate(a=[0,180,0], [10,10,10]) cube(1); 

// Equivalent expected results for both above examples
translate([10,10,10]) rotate([0,180,0]) translate([-10,-10,-10]) cube(1);

Tweaks to make building designs faster

I had a couple interface ideas that I think would be easy to implement, and which would make it easier to work with OpenSCAD for casual users.

First off: a menu of primitives or code snippets with keyboard accelerators. Selecting Cylinder from the menu will insert text like "cylinder(size = [1,2,3], center = true)" into the editor window, with some typical default values that the user can then edit. The purpose of this is that for us casual users, it makes it easier to remember what primitives we can use, and what their arguments are. Recommended items for this snippets menu are the shape primitives, transformation modifiers, and boolean ops.

Second idea: if the cursor is on a number in the editor window, and the user presses something like Alt+ or Alt- (or Command+/-, etc) the number will be incremented by some amount and the image will fast re-render with the item in the new position. For complex objects this will obviously be slow, but when making simpler objects, being able to visually move and rotate objects will make life a lot easier.

Large STLs uses lots of memory

When I try to import a complex STL file like Sappho from Thingiverse and render it in CGAL (F6) with an intersection, I get a crash after a few minutes. You can download the STL file I used from http://www.thingiverse.com/thing:14565. Compiling (F5) and doing a quick render works fine.

FILENAME="ThingiverseModels/Sapphos_Head_14565.stl";

module drawPrintableBase()
{
    // Save only the base
    translate([0,20,0])
    intersection()
    {
        import_stl(FILENAME, convexity = 5, center = true);

        translate([0,-50,0])
        cube([50,50,29]);
    }
}

drawPrintableBase();


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

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.