From 3b4fbb7246fae3295db837653f497ad1538f97af Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Tue, 13 Jan 2009 13:03:21 +0000 Subject: [PATCH] add examples --- tutorials/Makefile.am | 8 + tutorials/Makefile.in | 365 +++++++++++++++++++++++++++++++++++ tutorials/boxcyl.geo | 32 +++ tutorials/circle_on_cube.geo | 27 +++ tutorials/cone.geo | 13 ++ tutorials/cube.geo | 16 ++ tutorials/cubeandring.geo | 55 ++++++ tutorials/cubeandspheres.geo | 21 ++ tutorials/cubemcyl.geo | 18 ++ tutorials/cubemsphere.geo | 19 ++ tutorials/cylinder.geo | 12 ++ tutorials/cylsphere.geo | 12 ++ tutorials/ellipsoid.geo | 8 + tutorials/ellipticcyl.geo | 10 + tutorials/extrusion.geo | 99 ++++++++++ tutorials/fichera.geo | 24 +++ tutorials/lshape3d.geo | 26 +++ tutorials/manyholes.geo | 26 +++ tutorials/manyholes2.geo | 26 +++ tutorials/matrix.geo | 27 +++ tutorials/ortho.geo | 11 ++ tutorials/period.geo | 33 ++++ tutorials/revolution.geo | 18 ++ tutorials/sculpture.geo | 13 ++ tutorials/shaft.geo | 65 +++++++ tutorials/shell.geo | 10 + tutorials/sphere.geo | 8 + tutorials/sphereincube.geo | 17 ++ tutorials/torus.geo | 8 + tutorials/trafo.geo | 57 ++++++ tutorials/twobricks.geo | 15 ++ tutorials/twocubes.geo | 18 ++ tutorials/twocyl.geo | 16 ++ 33 files changed, 1133 insertions(+) create mode 100644 tutorials/Makefile.am create mode 100644 tutorials/Makefile.in create mode 100644 tutorials/boxcyl.geo create mode 100644 tutorials/circle_on_cube.geo create mode 100644 tutorials/cone.geo create mode 100644 tutorials/cube.geo create mode 100644 tutorials/cubeandring.geo create mode 100644 tutorials/cubeandspheres.geo create mode 100644 tutorials/cubemcyl.geo create mode 100644 tutorials/cubemsphere.geo create mode 100644 tutorials/cylinder.geo create mode 100644 tutorials/cylsphere.geo create mode 100644 tutorials/ellipsoid.geo create mode 100644 tutorials/ellipticcyl.geo create mode 100644 tutorials/extrusion.geo create mode 100644 tutorials/fichera.geo create mode 100644 tutorials/lshape3d.geo create mode 100644 tutorials/manyholes.geo create mode 100644 tutorials/manyholes2.geo create mode 100644 tutorials/matrix.geo create mode 100644 tutorials/ortho.geo create mode 100644 tutorials/period.geo create mode 100644 tutorials/revolution.geo create mode 100644 tutorials/sculpture.geo create mode 100644 tutorials/shaft.geo create mode 100644 tutorials/shell.geo create mode 100644 tutorials/sphere.geo create mode 100644 tutorials/sphereincube.geo create mode 100644 tutorials/torus.geo create mode 100644 tutorials/trafo.geo create mode 100644 tutorials/twobricks.geo create mode 100644 tutorials/twocubes.geo create mode 100644 tutorials/twocyl.geo diff --git a/tutorials/Makefile.am b/tutorials/Makefile.am new file mode 100644 index 00000000..226fbc92 --- /dev/null +++ b/tutorials/Makefile.am @@ -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 diff --git a/tutorials/Makefile.in b/tutorials/Makefile.in new file mode 100644 index 00000000..f11c591d --- /dev/null +++ b/tutorials/Makefile.in @@ -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: diff --git a/tutorials/boxcyl.geo b/tutorials/boxcyl.geo new file mode 100644 index 00000000..5aed7485 --- /dev/null +++ b/tutorials/boxcyl.geo @@ -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; + + diff --git a/tutorials/circle_on_cube.geo b/tutorials/circle_on_cube.geo new file mode 100644 index 00000000..b7a9fc5a --- /dev/null +++ b/tutorials/circle_on_cube.geo @@ -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]; + + diff --git a/tutorials/cone.geo b/tutorials/cone.geo new file mode 100644 index 00000000..0a749c5e --- /dev/null +++ b/tutorials/cone.geo @@ -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; diff --git a/tutorials/cube.geo b/tutorials/cube.geo new file mode 100644 index 00000000..bcacf4d3 --- /dev/null +++ b/tutorials/cube.geo @@ -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; + diff --git a/tutorials/cubeandring.geo b/tutorials/cubeandring.geo new file mode 100644 index 00000000..25629fdf --- /dev/null +++ b/tutorials/cubeandring.geo @@ -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); \ No newline at end of file diff --git a/tutorials/cubeandspheres.geo b/tutorials/cubeandspheres.geo new file mode 100644 index 00000000..d5ad4f65 --- /dev/null +++ b/tutorials/cubeandspheres.geo @@ -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; diff --git a/tutorials/cubemcyl.geo b/tutorials/cubemcyl.geo new file mode 100644 index 00000000..37a66813 --- /dev/null +++ b/tutorials/cubemcyl.geo @@ -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; diff --git a/tutorials/cubemsphere.geo b/tutorials/cubemsphere.geo new file mode 100644 index 00000000..ba9e7cc5 --- /dev/null +++ b/tutorials/cubemsphere.geo @@ -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; + diff --git a/tutorials/cylinder.geo b/tutorials/cylinder.geo new file mode 100644 index 00000000..4279fff6 --- /dev/null +++ b/tutorials/cylinder.geo @@ -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; diff --git a/tutorials/cylsphere.geo b/tutorials/cylsphere.geo new file mode 100644 index 00000000..4afffa55 --- /dev/null +++ b/tutorials/cylsphere.geo @@ -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; diff --git a/tutorials/ellipsoid.geo b/tutorials/ellipsoid.geo new file mode 100644 index 00000000..78d2fadd --- /dev/null +++ b/tutorials/ellipsoid.geo @@ -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; diff --git a/tutorials/ellipticcyl.geo b/tutorials/ellipticcyl.geo new file mode 100644 index 00000000..8346abf5 --- /dev/null +++ b/tutorials/ellipticcyl.geo @@ -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; diff --git a/tutorials/extrusion.geo b/tutorials/extrusion.geo new file mode 100644 index 00000000..41e69d48 --- /dev/null +++ b/tutorials/extrusion.geo @@ -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; \ No newline at end of file diff --git a/tutorials/fichera.geo b/tutorials/fichera.geo new file mode 100644 index 00000000..a0c09c35 --- /dev/null +++ b/tutorials/fichera.geo @@ -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; + diff --git a/tutorials/lshape3d.geo b/tutorials/lshape3d.geo new file mode 100644 index 00000000..18d96566 --- /dev/null +++ b/tutorials/lshape3d.geo @@ -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; + + + + + + + diff --git a/tutorials/manyholes.geo b/tutorials/manyholes.geo new file mode 100644 index 00000000..6c4721ce --- /dev/null +++ b/tutorials/manyholes.geo @@ -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); diff --git a/tutorials/manyholes2.geo b/tutorials/manyholes2.geo new file mode 100644 index 00000000..2f6b17cd --- /dev/null +++ b/tutorials/manyholes2.geo @@ -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); diff --git a/tutorials/matrix.geo b/tutorials/matrix.geo new file mode 100644 index 00000000..ed5947de --- /dev/null +++ b/tutorials/matrix.geo @@ -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; diff --git a/tutorials/ortho.geo b/tutorials/ortho.geo new file mode 100644 index 00000000..db5dae7a --- /dev/null +++ b/tutorials/ortho.geo @@ -0,0 +1,11 @@ +# +## A cube +# +algebraic3d + +# cube consisting of 6 planes: + +solid cube = orthobrick (0, 0, 0; 1, 1, 1); + +tlo cube; + diff --git a/tutorials/period.geo b/tutorials/period.geo new file mode 100644 index 00000000..98d0e860 --- /dev/null +++ b/tutorials/period.geo @@ -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; + diff --git a/tutorials/revolution.geo b/tutorials/revolution.geo new file mode 100644 index 00000000..89ee2343 --- /dev/null +++ b/tutorials/revolution.geo @@ -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; \ No newline at end of file diff --git a/tutorials/sculpture.geo b/tutorials/sculpture.geo new file mode 100644 index 00000000..4971e0d2 --- /dev/null +++ b/tutorials/sculpture.geo @@ -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]; diff --git a/tutorials/shaft.geo b/tutorials/shaft.geo new file mode 100644 index 00000000..8bb4ce32 --- /dev/null +++ b/tutorials/shaft.geo @@ -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; diff --git a/tutorials/shell.geo b/tutorials/shell.geo new file mode 100644 index 00000000..de65535c --- /dev/null +++ b/tutorials/shell.geo @@ -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; + + + diff --git a/tutorials/sphere.geo b/tutorials/sphere.geo new file mode 100644 index 00000000..52b90174 --- /dev/null +++ b/tutorials/sphere.geo @@ -0,0 +1,8 @@ +algebraic3d + +solid main = sphere (0, 0, 0; 1); + +tlo main; +point (0, 0, 0); + + diff --git a/tutorials/sphereincube.geo b/tutorials/sphereincube.geo new file mode 100644 index 00000000..2c3beb95 --- /dev/null +++ b/tutorials/sphereincube.geo @@ -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]; + diff --git a/tutorials/torus.geo b/tutorials/torus.geo new file mode 100644 index 00000000..ae5e9533 --- /dev/null +++ b/tutorials/torus.geo @@ -0,0 +1,8 @@ +# +## a torus +# +algebraic3d + +solid tor = torus ( 0, 0, 0; 1, 0, 0; 2 ; 1 ); + +tlo tor; diff --git a/tutorials/trafo.geo b/tutorials/trafo.geo new file mode 100644 index 00000000..e0df385c --- /dev/null +++ b/tutorials/trafo.geo @@ -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]; + + + + diff --git a/tutorials/twobricks.geo b/tutorials/twobricks.geo new file mode 100644 index 00000000..205fa955 --- /dev/null +++ b/tutorials/twobricks.geo @@ -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]; + diff --git a/tutorials/twocubes.geo b/tutorials/twocubes.geo new file mode 100644 index 00000000..d4fa2b4c --- /dev/null +++ b/tutorials/twocubes.geo @@ -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]; + diff --git a/tutorials/twocyl.geo b/tutorials/twocyl.geo new file mode 100644 index 00000000..ca1dbf5f --- /dev/null +++ b/tutorials/twocyl.geo @@ -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;