Skip to content
Browse files

Merge branch 'master' into lion

Conflicts:
	README.md
	scripts/macosx-build-dependencies.sh
	src/linearextrude.cc
	src/parsersettings.cc
  • Loading branch information...
2 parents dfa7d80 + 38a4585 commit ebc382dd4a95013e7e6119d0b99452e37f574108 @kintel kintel committed Jul 9, 2012
Showing with 41 additions and 14 deletions.
  1. +27 −11 contrib/{scad.el → scad-mode.el}
  2. +4 −3 scripts/macosx-build-dependencies.sh
  3. +1 −0 setenv_mjau.sh
  4. +9 −0 src/linearextrude.cc
View
38 contrib/scad.el → contrib/scad-mode.el
@@ -1,10 +1,12 @@
-;;; scad.el --- SCAD mode derived mode
+;;; scad-mode.el --- SCAD mode derived mode
;; Author: Len Trigg
;; Maintainer: Len Trigg <lenbok@gmail.com>
;; Created: March 2010
-;; Modified: November 2011
-;; Version: $Revision: 88 $
+;; Modified: 06 July 2012
+;; Keywords: languages
+;; URL: https://raw.github.com/openscad/openscad/master/contrib/scad-mode.el
+;; Version: 90.0
;; 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
@@ -23,19 +25,27 @@
;;; Commentary:
;;
-;; This is a separate mode to implement the SCAD constructs and
-;; font-locking.
+;; This is a major-mode to implement the SCAD constructs and
+;; font-locking for openscad
;;
-;; To use, insert the following into your emacs startup:
+;; If installing manually, insert the following into your emacs startup:
;;
-;; (autoload 'scad-mode "scad" "Major mode for editing SCAD code." t)
+;; (autoload 'scad-mode "scad-mode" "Major mode for editing SCAD code." t)
;; (add-to-list 'auto-mode-alist '("\\.scad$" . scad-mode))
+;;
+;; or
+;;
+;; install from marmalade: http://marmalade-repo.org/
+;; M-x install-package <ENTER> scad-mode <ENTER>
+
;;; To Do:
;; - Support for background/debug/root/disable modifiers
;; - Font lock of non-built-in function calls
-;;; Autoload mode trigger
+;;; Code:
+
+;;;###autoload
(add-to-list 'auto-mode-alist '("\\.scad$" . scad-mode))
(defcustom scad-command
@@ -152,8 +162,14 @@
:syntax-table scad-mode-syntax-table
(set (make-local-variable 'font-lock-defaults) '(scad-font-lock-keywords))
(set (make-local-variable 'indent-line-function) 'scad-indent-line)
- ;(set (make-local-variable 'imenu-generic-expression) scad-imenu-generic-expression)
- ;(set (make-local-variable 'outline-regexp) scad-outline-regexp)
+ ;(set (make-local-variable 'imenu-generic-expression) scad-imenu-generic-expression)
+ ;(set (make-local-variable 'outline-regexp) scad-outline-regexp)
+ ;; set comment styles for scad mode
+ (set (make-local-variable 'comment-start) "//")
+ (set (make-local-variable 'comment-end) "")
+ (set (make-local-variable 'block-comment-start) "/*")
+ (set (make-local-variable 'block-comment-end) "*/")
+
)
@@ -219,4 +235,4 @@
(call-process scad-command nil 0 nil (buffer-file-name)))
(provide 'scad)
-;;; scad.el ends here
+;;; scad-mode.el ends here
View
7 scripts/macosx-build-dependencies.sh
@@ -11,7 +11,7 @@
# -l Force use of LLVM compiler
#
# Prerequisites:
-# - MacPorts: curl
+# - MacPorts: curl, cmake
# - Qt4
#
# FIXME:
@@ -26,6 +26,7 @@ DEPLOYDIR=$BASEDIR/install
MAC_OSX_VERSION_MIN=10.5
OPTION_32BIT=true
OPTION_LLVM=false
+export QMAKESPEC=macx-g++
printUsage()
{
@@ -132,11 +133,11 @@ build_mpfr()
cd $BASEDIR/src
rm -rf mpfr-$version
if [ ! -f mpfr-$version.tar.bz2 ]; then
- curl -O http://www.mpfr.org/mpfr-current/mpfr-$version.tar.bz2
+ curl -O http://www.mpfr.org/mpfr-$version/mpfr-$version.tar.bz2
fi
tar xjf mpfr-$version.tar.bz2
cd mpfr-$version
- curl -O http://www.mpfr.org/mpfr-current/allpatches
+ curl -O http://www.mpfr.org/mpfr-$version/allpatches
patch -N -Z -p1 < allpatches
if $OPTION_32BIT; then
mkdir build-i386
View
1 setenv_mjau.sh
@@ -1,5 +1,6 @@
export OPENSCAD_LIBRARIES=$PWD/../libraries/install
export DYLD_LIBRARY_PATH=$OPENSCAD_LIBRARIES/lib
+export QMAKESPEC=macx-g++
#export OPENCSGDIR=$PWD/../OpenCSG-1.3.0
#export CGALDIR=$PWD/../install/CGAL-3.6
View
9 src/linearextrude.cc
@@ -81,6 +81,15 @@ AbstractNode *LinearExtrudeModule::evaluate(const Context *ctx, const ModuleInst
origin.getVec2(node->origin_x, node->origin_y);
node->scale = scale.toDouble();
+ // if height not given, and first argument is a number,
+ // then assume it should be the height.
+ if (c.lookup_variable("height").type == Value::UNDEFINED &&
+ inst->argnames.size() > 0 &&
+ inst->argnames[0] == "" &&
+ inst->argvalues[0].type == Value::NUMBER) {
+ height = Value(inst->argvalues[0]);
+ }
+
if (center.type() == Value::BOOL)
node->center = center.toBool();

0 comments on commit ebc382d

Please sign in to comment.
Something went wrong with that request. Please try again.