add examples

This commit is contained in:
Joachim Schoeberl 2009-01-13 13:03:21 +00:00
parent c6ee5b77c6
commit 3b4fbb7246
33 changed files with 1133 additions and 0 deletions

8
tutorials/Makefile.am Normal file
View File

@ -0,0 +1,8 @@
INCLUDES =
METASOURCES = AUTO
pkgdata_SCRIPTS = boxcyl.geo circle_on_cube.geo cone.geo cube.geo \
cubeandring.geo cubeandspheres.geo cubemcyl.geo cubemsphere.geo cylinder.geo \
cylsphere.geo ellipsoid.geo ellipticcyl.geo extrusion.geo fichera.geo lshape3d.geo \
manyholes.geo manyholes2.geo matrix.geo ortho.geo period.geo revolution.geo \
sculpture.geo shaft.geo shell.geo sphere.geo sphereincube.geo torus.geo trafo.geo \
twobricks.geo twocubes.geo twocyl.geo

365
tutorials/Makefile.in Normal file
View File

@ -0,0 +1,365 @@
# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = tutorials
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(pkgdatadir)"
pkgdataSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(pkgdata_SCRIPTS)
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
INCLUDES =
METASOURCES = AUTO
pkgdata_SCRIPTS = boxcyl.geo circle_on_cube.geo cone.geo cube.geo \
cubeandring.geo cubeandspheres.geo cubemcyl.geo cubemsphere.geo cylinder.geo \
cylsphere.geo ellipsoid.geo ellipticcyl.geo extrusion.geo fichera.geo lshape3d.geo \
manyholes.geo manyholes2.geo matrix.geo ortho.geo period.geo revolution.geo \
sculpture.geo shaft.geo shell.geo sphere.geo sphereincube.geo torus.geo trafo.geo \
twobricks.geo twocubes.geo twocyl.geo
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tutorials/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu tutorials/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-pkgdataSCRIPTS: $(pkgdata_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " $(pkgdataSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
$(pkgdataSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
else :; fi; \
done
uninstall-pkgdataSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(pkgdata_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
for dir in "$(DESTDIR)$(pkgdatadir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-pkgdataSCRIPTS
install-dvi: install-dvi-am
install-exec-am:
install-html: install-html-am
install-info: install-info-am
install-man:
install-pdf: install-pdf-am
install-ps: install-ps-am
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-pkgdataSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-pkgdataSCRIPTS install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-pkgdataSCRIPTS
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

32
tutorials/boxcyl.geo Normal file
View File

@ -0,0 +1,32 @@
#
## Two cylinders on a box
#
algebraic3d
#define box:
solid box = plane (0, 0, 0.5; -1, 0, 0)
and plane (0, 0, 0.5; 0, -1, 0)
and plane (0, 0, 0.5; 0, 0, -1)
and plane (2, 1.5, 1; 1, 0, 0)
and plane (2, 1.5, 1; 0, 1, 0)
and plane (2, 1.5, 1; 0, 0, 1);
#define cylinders:
solid cyls = (cylinder (0.5, 0.75, 0; 0.5, 0.75, 2; 0.3)
or cylinder (1.5, 0.75, 0; 1.5, 0.75, 2; 0.3) )
and plane (0, 0, 0.7; 0, 0, -1)
and plane (0, 0, 1.5; 0, 0, 1);
#combine both:
solid main = box or cyls;
#define sub-domains:
tlo main;
singular edge box cyls;

View File

@ -0,0 +1,27 @@
#
## A cube
#
algebraic3d
# cube consisting of 6 planes:
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid top = plane (1,1,1; 0, 0, 1);
solid cyl = top
and plane (0,0,0; 0, 0, -1)
and cylinder (0.5, 0.5, 0; 0.5, 0.5, 1; 0.2);
tlo cube;
# take just surface 'top' of solid 'cyl'
tlo cyl top -col=[1,0,0];

13
tutorials/cone.geo Normal file
View File

@ -0,0 +1,13 @@
#
## A cone
#
algebraic3d
# Cone given by bottom circle and top circle
# and cut by planes:
solid cutcone = cone ( 0, 0, 0; 1; 3, 0, 0; 0.1 )
and plane (0, 0, 0; -1, 0, 0)
and plane (3, 0, 0; 1, 0, 0);
tlo cutcone;

16
tutorials/cube.geo Normal file
View File

@ -0,0 +1,16 @@
#
## A cube
#
algebraic3d
# cube consisting of 6 planes:
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
tlo cube;

55
tutorials/cubeandring.geo Normal file
View File

@ -0,0 +1,55 @@
algebraic3d
curve2d testcurve=(8;
-0.5,1;
-0.55,1.5;
-0.275,1.775;
0,2.05;
0.5,2;
0.55,1.5;
0.5,1;
0,0.95;
4;
3,8,1,2;
3,2,3,4;
3,4,5,6;
3,6,7,8);
#curve2d testcurve=(8;
# -0.5,1;
# -0.55,1.5;
# -0.5,2;
# 0,2.05;
# 0.5,2;
# 0.55,1.5;
# 0.5,1;
# 0,0.95;
# 4;
# 3,8,1,2;
# 3,2,3,4;
# 3,4,5,6;
# 3,6,7,8);
curve2d testcurve1=(4;
-0.55,1.5;
0,2.05;
0.55,1.5;
0,0.95;
4;
2,1,2;
2,2,3;
2,3,4;
2,4,1);
solid mytorus = revolution(0,0,0.5;1,0,0.5;testcurve);
#solid mytorus = revolution(0,0,0.5;1,0,0.5;testcurve1);
solid bbb = orthobrick(-4,-4,-4;4,4,0.1);
solid brickandring = mytorus or bbb;
tlo brickandring;
point (-3.8, 3.8, 0.1);

View File

@ -0,0 +1,21 @@
#
## Cube and Spheres
#
algebraic3d
# a cube
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
# two shperes
solid sph1 = sphere (0.5, 0.5, 0.5; 0.58);
solid sph2 = sphere (0.5, 0.5, 0.5; 0.75);
# cut cube with inner and outer sphere
solid main = cube and sph2 and not sph1;
tlo main;

18
tutorials/cubemcyl.geo Normal file
View File

@ -0,0 +1,18 @@
#
## Cube minus Cylinder
#
algebraic3d
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid cyl = cylinder (0.5, 0.5, 0; 0.5, 0.5, 1; 0.03);
# cut off small cylinder from cube:
solid main = cube and not cyl;
tlo main;

19
tutorials/cubemsphere.geo Normal file
View File

@ -0,0 +1,19 @@
#
## Cube minus Cylinder
#
algebraic3d
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid sp = sphere (0.5, 0.5, 0; 0.001);
# cut off small sphere:
solid main = cube and not sp;
tlo main;

12
tutorials/cylinder.geo Normal file
View File

@ -0,0 +1,12 @@
#
## a cylinder
#
algebraic3d
# cut cylinder by planes:
solid fincyl = cylinder ( 3, 0, 0; -1, 0, 0; 0.5 )
and plane (0, 0, 0; -1, 0, 0)
and plane (2, 0, 0; 1, 0, 0);
tlo fincyl;

12
tutorials/cylsphere.geo Normal file
View File

@ -0,0 +1,12 @@
#
## Cylinder and Spehre
#
algebraic3d
solid cyl = cylinder ( 3, 0, 0; -3, 0, 0; 0.5 )
and plane (-2, 0, 0; -1, 0, 0)
and plane (2, 0, 0; 1, 0, 0);
solid sp = sphere (0, 0, 0; 1);
solid main = sp or cyl;
tlo main;

8
tutorials/ellipsoid.geo Normal file
View File

@ -0,0 +1,8 @@
#
## An elliptic cylinder
#
algebraic3d
solid test = ellipsoid (0, 0, 0; 2, 0, 0; 0, 1, 0; 0, 0, 1) -maxh=0.5;
tlo test;

10
tutorials/ellipticcyl.geo Normal file
View File

@ -0,0 +1,10 @@
#
## An elliptic cylinder
#
algebraic3d
solid cutcone = ellipticcylinder ( 0, 0, 0; 1, 0, 0; 0, 0.5, 0)
and plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 1; 0, 0, 1);
tlo cutcone;

99
tutorials/extrusion.geo Normal file
View File

@ -0,0 +1,99 @@
algebraic3d
curve2d procurve1=(8;
-1,0;
-0.7,0.7;
0,1;
0.7,0.7;
1,0;
0.7,-0.7;
0,-1;
-0.7,-0.7;
4;
3,1,2,3;
3,3,4,5;
3,5,6,7;
3,7,8,1);
curve2d procurve2=(4;
1,1;
1,-1;
-1,-1;
-1,1;
4;
2,1,2;
2,2,3;
2,3,4;
2,4,1);
curve3d pathcurve1=(9;
0,0,0;
10,0,5;
10,10,10;
10,20,15;
0,20,20;
-10,20,25;
-10,10,30;
-10,0,35;
0,0,40;
4;
3,1,2,3;
3,3,4,5;
3,5,6,7;
3,7,8,9);
curve3d pathcurve2=(2;
0,0,0;
0,10,0;
1;
2,1,2);
curve3d pathcurve3=(3;
0,0,0;
10,0,5;
10,10,10;
1;
3,1,2,3);
curve3d pathcurve4=(9;
0,0,0;
10,0,0;
10,10,0;
10,20,0;
0,20,0;
-10,20,0;
-10,10,0;
-10,0,0;
0,0,0;
4;
3,1,2,3;
3,3,4,5;
3,5,6,7;
3,7,8,9);
solid p1 = plane(1,0,0;-1,0,0);
solid p2 = plane(10,9,10;0,1,0);
solid p3 = plane(0,1,0;0,-1,0);
solid p4 = plane(0,9,0;0,1,0);
solid ob1 = orthobrick(-1,-5,-5;1,5,45);
solid ext = extrusion(pathcurve1;procurve2;0,0,1) and not ob1;
#solid ext = extrusion(pathcurve4;procurve2;0,0,1);
#solid ext = extrusion(pathcurve3;procurve1;0,0,1) and p1 and p2;
#solid ext = extrusion(pathcurve2;procurve2;0,0,1) and p3 and p4;
solid sp = sphere(0,0,0;4);
solid comb = sp or ext;
#tlo ext;
tlo comb;

24
tutorials/fichera.geo Normal file
View File

@ -0,0 +1,24 @@
#
## Fichera Cube
#
algebraic3d
solid c1 = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0) -bc=2;
solid c2 = plane (-0.5, -0.5, -0.5; 0, 0, -1)
and plane (-0.5, -0.5, -0.5; 0, -1, 0)
and plane (-0.5, -0.5, -0.5; -1, 0, 0)
and plane (0.5, 0.5, 0.5; 0, 0, 1)
and plane (0.5, 0.5, 0.5; 0, 1, 0)
and plane (0.5, 0.5, 0.5; 1, 0, 0);
# cut off small cube
solid main = c1 and not c2 -bc=1;
tlo main;

26
tutorials/lshape3d.geo Normal file
View File

@ -0,0 +1,26 @@
algebraic3d
#
## 3D Lshape - domain
#
solid c1 = plane (-1, -1, 0; 0, 0, -1)
and plane (-1, -1, 0; 0, -1, 0)
and plane (-1, -1, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid f1 = plane (0, 0, 0; -1, 0, 0);
solid f2 = plane (0, 0, 0; 0, 1, 0);
solid main = c1 and not (f1 and f2);
tlo main;

26
tutorials/manyholes.geo Normal file
View File

@ -0,0 +1,26 @@
algebraic3d
#
## CSG feature copy
#
# define a axis parallel brick:
solid br = orthobrick (0, 0, 0; 10, 10, 1);
# define reference cylinder:
solid cyl1 = cylinder (0.5, 0.5, -1; 0.5, 0.5, 3; 0.2);
# make copies:
solid cylx = multitranslate (1, 0, 0; 9; cyl1);
solid cyls = multitranslate (0, 1, 0; 9; cylx);
solid main = br and not cyls;
tlo main;
# provide bounding-box for fastening bisection alg:
boundingbox (-1, -1, -1; 11, 11, 2);

26
tutorials/manyholes2.geo Normal file
View File

@ -0,0 +1,26 @@
algebraic3d
#
## CSG feature copy
#
# define a axis parallel brick:
solid br = orthobrick (0, 0, 0; 20, 20, 1);
# define reference cylinder:
solid cyl1 = cylinder (0.5, 0.5, -1; 0.5, 0.5, 3; 0.2);
# make copies:
solid cylx = multitranslate (1, 0, 0; 19; cyl1);
solid cyls = multitranslate (0, 1, 0; 19; cylx);
solid main = br and not cyls;
tlo main;
# provide bounding-box for fastening bisection alg:
boundingbox (-1, -1, -1; 21, 21, 2);

27
tutorials/matrix.geo Normal file
View File

@ -0,0 +1,27 @@
#
# a matrix with holes
#
algebraic3d
solid holes = sphere (0.3, 0.4, 0.4; 0.1)
or sphere (0.7, 0.2, 0.8; 0.15)
or sphere (0.8, 0.5, 0.4; 0.11)
or sphere (0.6, 0.2, 0.8; 0.13)
or sphere (0.4, 0.3, 0.6; 0.14)
or sphere (0.6, 0.3, 0.4; 0.16)
or sphere (0.2, 0.8, 0.6; 0.17)
or sphere (0.4, 0.6, 0.5; 0.2);
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid rest = cube and not holes;
# two sub-domains
tlo holes -col=[1,0,0];
tlo rest -col=[0,0,1] -transparent;

11
tutorials/ortho.geo Normal file
View File

@ -0,0 +1,11 @@
#
## A cube
#
algebraic3d
# cube consisting of 6 planes:
solid cube = orthobrick (0, 0, 0; 1, 1, 1);
tlo cube;

33
tutorials/period.geo Normal file
View File

@ -0,0 +1,33 @@
##
## Example with periodic boundary conditions
## by Joachim Schoeberl
##
##
algebraic3d
solid p1 = plane (0, 0, 0; 0, 0, -1);
solid p2 = plane (1, 1, 1; 0, 0, 1);
solid p3 = plane (0, 0, 0; 0, -1, 0);
solid p4 = plane (1, 1, 1; 0, 1, 0);
solid p5 = plane (0, 0, 0; -1, 0, 0);
solid p6 = plane (1, 1, 1; 1, 0, 0);
solid cube = p1 and p2 and p3 and p4 and p5 and p6;
solid cyls =
cylinder (0.5, 0.5, 0; 0.5, 0.5, 1; 0.3)
or cylinder (0, 0.5, 0.2; 1, 0.5, 0.2; 0.1);
solid matrix = cube and not cyls;
solid inner = cube and cyls;
tlo matrix -transparent;
tlo inner -col=[1,0,0];
identify periodic p1 p2;
identify periodic p3 p4;
identify periodic p5 p6;

18
tutorials/revolution.geo Normal file
View File

@ -0,0 +1,18 @@
algebraic3d
curve2d testcurve=(7;
1,0;
1,1;
1.5,1.5;
2,3;
2.5,1.5;
3,1;
3,0;
3;
3,1,2,3;
3,3,4,5;
3,5,6,7);
solid something = revolution(0,0,0;1,0,0;testcurve);
tlo something;

13
tutorials/sculpture.geo Normal file
View File

@ -0,0 +1,13 @@
algebraic3d
#
# intersection of sphere and cylinders
# motivated by a sculpture found in St. Gallen
#
solid cyls = cylinder ( -100, 0, 0; 200, 0, 0; 40 )
or cylinder ( 100, -100, 100; 100, 200, 100; 40)
or cylinder ( 0, 100, -100; 0, 100, 200; 40);
solid sculpture = sphere (50, 50, 50; 80) and not cyls
and not sphere (50, 50, 50; 50);
tlo sculpture -col=[0.5, 0.5, 0.5];

65
tutorials/shaft.geo Normal file
View File

@ -0,0 +1,65 @@
#
## Crankshaft
#
algebraic3d
solid p1 = plane (0, 0, 0; -1, 0, 0)
and plane (10, 0, 0; 1, 0, 0)
and
( plane (35, 0, 28; 0, -1, 3)
and plane (35, 0, -28; 0, -1, -3)
and plane (35, 0, 0; 0, 1, 0)
and plane (35, -30, 0; 0, -1, 0)
or cylinder (-10, 0, 0; 20, 0, 0; 30)
or cylinder (-10, -30, 0; 20, -30, 0; 20)
);
solid p2 = plane (35, 0, 0; -1, 0, 0)
and plane (45, 0, 0; 1, 0, 0)
and
( plane (35, 0, 28; 0, -1, 3)
and plane (35, 0, -28; 0, -1, -3)
and plane (35, 0, 0; 0, 1, 0)
and plane (35, -30, 0; 0, -1, 0)
or cylinder (30, 0, 0; 50, 0, 0; 30)
or cylinder (30, -30, 0; 50, -30, 0; 20)
);
solid p3 = plane (80, 0, 0; -1, 0, 0)
and plane (90, 0, 0; 1, 0, 0)
and
( plane (0, 0, 28; 0, 1, 3)
and plane (0, 0, -28; 0, 1, -3)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 30, 0; 0, 1, 0)
or cylinder (70, 0, 0; 100, 0, 0; 30)
or cylinder (70, 30, 0; 100, 30, 0; 20)
);
solid p4 = plane (115, 0, 0; -1, 0, 0)
and plane (125, 0, 0; 1, 0, 0)
and
( plane (35, 0, 28; 0, 1, 3)
and plane (35, 0, -28; 0, 1, -3)
and plane (35, 0, 0; 0, -1, 0)
and plane (35, 30, 0; 0, 1, 0)
or cylinder (110, 0, 0; 130, 0, 0; 30)
or cylinder (110, 30, 0;130, 30, 0; 20)
);
solid sh1 = cylinder (-50, 0, 0; 10, 0, 0; 15)
and plane (-40, 0, 0; -1, 0, 0)
and plane (5, 0, 0; 1, 0, 0);
solid sh2 = cylinder (30, 0, 0; 90, 0, 0; 15)
and plane (40, 0, 0; -1, 0, 0)
and plane (85, 0, 0; 1, 0, 0);
solid sh3 = cylinder (110, 0, 0; 170, 0, 0; 15)
and plane (120, 0, 0; -1, 0, 0)
and plane (165, 0, 0; 1, 0, 0);
solid pl1 = cylinder (0, -30, 0; 50, -30, 0; 10)
and plane (5, 0, 0; -1, 0, 0)
and plane (40, 0, 0; 1, 0, 0);
solid pl2 = cylinder (80, 30, 0; 130, 30, 0; 10)
and plane (85, 0, 0; -1, 0, 0)
and plane (120, 0, 0; 1, 0, 0);
#
#
solid main = p1 or p2 or p3 or p4 or sh1 or sh2 or sh3 or pl1 or pl2;
tlo main;

10
tutorials/shell.geo Normal file
View File

@ -0,0 +1,10 @@
algebraic3d
solid main = sphere (0, 0, 0; 1)
and not sphere (0, 0, 0; 0.98);
# or orthobrick (-0.4, -0.4, -0.4; 0.4, 0.4, 0.4);
tlo main -maxh=0.02;

8
tutorials/sphere.geo Normal file
View File

@ -0,0 +1,8 @@
algebraic3d
solid main = sphere (0, 0, 0; 1);
tlo main;
point (0, 0, 0);

View File

@ -0,0 +1,17 @@
algebraic3d
#
# Example with two sub-domains:
#
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid sph = sphere (0.5, 0.5, 0.5; 0.3);
solid rest = cube and not sph;
tlo rest -transparent -col=[0,0,1];
tlo sph -col=[1,0,0];

8
tutorials/torus.geo Normal file
View File

@ -0,0 +1,8 @@
#
## a torus
#
algebraic3d
solid tor = torus ( 0, 0, 0; 1, 0, 0; 2 ; 1 );
tlo tor;

57
tutorials/trafo.geo Normal file
View File

@ -0,0 +1,57 @@
algebraic3d
#
# a transformer
#
solid core =
plane (-8, 0, 0; -1, 0, 0)
and plane ( 8, 0, 0; 1, 0, 0)
and plane ( 0, -6, 0; 0, -1, 0)
and plane ( 0, 6, 0; 0, 1, 0)
and plane ( 0, 0, -1; 0, 0, -1)
and plane ( 0, 0, 1; 0, 0, 1)
and not
( plane (-6, 0, 0; -1, 0, 0)
and plane (-1, 0, 0; 1, 0, 0)
and plane ( 0, -4, 0; 0, -1, 0)
and plane ( 0, 4, 0; 0, 1, 0) )
and not
( plane ( 6, 0, 0; 1, 0, 0)
and plane ( 1, 0, 0; -1, 0, 0)
and plane ( 0, -4, 0; 0, -1, 0)
and plane ( 0, 4, 0; 0, 1, 0) );
solid coil1 =
cylinder (-7, -3, 0;-7, 3, 0; 3)
and not cylinder (-7, -3, 0;-7, 3, 0; 2)
and plane (0, -3, 0; 0, -1, 0)
and plane (0, 3, 0; 0, 1, 0);
solid coil2 =
cylinder ( 0, -3, 0; 0, 3, 0; 3)
and not cylinder ( 0, -3, 0; 0, 3, 0; 2)
and plane (0, -3, 0; 0, -1, 0)
and plane (0, 3, 0; 0, 1, 0);
solid coil3 =
cylinder ( 7, -3, 0; 7, 3, 0; 3)
and not cylinder ( 7, -3, 0; 7, 3, 0; 2)
and plane (0, -3, 0; 0, -1, 0)
and plane (0, 3, 0; 0, 1, 0);
solid box =
plane (-12, 0, 0; -1, 0, 0)
and plane ( 12, 0, 0; 1, 0, 0)
and plane ( 0, 8, 0; 0, 1, 0)
and plane ( 0,-8, 0; 0, -1, 0)
and plane ( 0, 0, 5; 0, 0, 1)
and plane ( 0, 0, -5; 0, 0, -1);
solid air = box and not core and not coil1 and not coil2 and not coil3;
tlo coil1 -col=[0,1,0];
tlo coil2 -col=[0,1,0];
tlo coil3 -col=[0,1,0];
tlo air -col=[0,0,1] -transparent;
tlo core -col=[1,1,0];

15
tutorials/twobricks.geo Normal file
View File

@ -0,0 +1,15 @@
algebraic3d
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid cutplane = plane (0.5, 0, 0; -1, 0, 0);
solid right = cube and cutplane;
solid left = cube and not cutplane;
tlo right -col=[1,0,0];
tlo left -col=[0,0,1];

18
tutorials/twocubes.geo Normal file
View File

@ -0,0 +1,18 @@
algebraic3d
# example with two sub-domains
solid cube = plane (0, 0, 0; 0, 0, -1)
and plane (0, 0, 0; 0, -1, 0)
and plane (0, 0, 0; -1, 0, 0)
and plane (1, 1, 1; 0, 0, 1)
and plane (1, 1, 1; 0, 1, 0)
and plane (1, 1, 1; 1, 0, 0);
solid cutplane = plane (0.5, 0, 0; -1, 0, 0);
solid right = cube and cutplane;
solid left = cube and not cutplane;
tlo right -col=[1,0,0];
tlo left -col=[0,0,1];

16
tutorials/twocyl.geo Normal file
View File

@ -0,0 +1,16 @@
algebraic3d
#
# two intersecting cylinderes
#
solid cyl1 = cylinder ( 1, 0, 0; -1, 0, 0; 0.5 )
and plane (-1, 0, 0; -1, 0, 0)
and plane (1, 0, 0; 1, 0, 0);
solid cyl2 = cylinder ( 0, 1, 0.3; 0, -1, 0.3; 0.5 )
and plane (0, -1, 0; 0, -1, 0)
and plane (0, 1, 0; 0, 1, 0);
solid main = cyl1 or cyl2;
tlo main;