├── .gitignore ├── CMakeLists.txt ├── Doxyfile ├── LICENSE.txt ├── README.md ├── README.txt ├── changelog.txt ├── cmake ├── FindSubversion.cmake ├── runtest.cmake └── vcs-revision.cmake ├── data ├── CMakeLists.txt └── dxf │ ├── &.dxf │ ├── &m.dxf │ ├── 0.dxf │ ├── 1.dxf │ ├── 2.dxf │ ├── 3.dxf │ ├── 4.dxf │ ├── 5.dxf │ ├── 6.dxf │ ├── 7.dxf │ ├── 8.dxf │ ├── 9.dxf │ ├── A.dxf │ ├── B.dxf │ ├── C.dxf │ ├── D.dxf │ ├── E.dxf │ ├── F.dxf │ ├── G.dxf │ ├── H.dxf │ ├── I.dxf │ ├── J.dxf │ ├── K.dxf │ ├── L.dxf │ ├── M.dxf │ ├── N.dxf │ ├── O.dxf │ ├── P.dxf │ ├── Q.dxf │ ├── R.dxf │ ├── S.dxf │ ├── T.dxf │ ├── U.dxf │ ├── V.dxf │ ├── W.dxf │ ├── X.dxf │ ├── Y.dxf │ ├── Z.dxf │ ├── am.dxf │ ├── bm.dxf │ ├── cm.dxf │ ├── dm.dxf │ ├── em.dxf │ ├── fm.dxf │ ├── gm.dxf │ ├── hm.dxf │ ├── im.dxf │ ├── jm.dxf │ ├── km.dxf │ ├── lm.dxf │ ├── mm.dxf │ ├── nm.dxf │ ├── om.dxf │ ├── pm.dxf │ ├── qm.dxf │ ├── rm.dxf │ ├── sm.dxf │ ├── tm.dxf │ ├── um.dxf │ ├── vm.dxf │ ├── wm.dxf │ ├── xm.dxf │ ├── ym.dxf │ └── zm.dxf ├── images └── string.png ├── src ├── CMakeLists.txt ├── components.h ├── components │ ├── CMakeLists.txt │ ├── Char.cpp │ ├── Char.h │ ├── Circle.cpp │ ├── Circle.h │ ├── Cube.cpp │ ├── Cube.h │ ├── Cylinder.cpp │ ├── Cylinder.h │ ├── CylindricalSection.cpp │ ├── CylindricalSection.h │ ├── LinksView.cpp │ ├── LinksView.h │ ├── PolygonalPiramid.cpp │ ├── PolygonalPiramid.h │ ├── PolygonalPrism.cpp │ ├── PolygonalPrism.h │ ├── RefSysView.cpp │ ├── RefSysView.h │ ├── RegularPiramid.cpp │ ├── RegularPiramid.h │ ├── RegularPrism.cpp │ ├── RegularPrism.h │ ├── RoundedCube.cpp │ ├── RoundedCube.h │ ├── RoundedCylinder.cpp │ ├── RoundedCylinder.h │ ├── RoundedTablet.cpp │ ├── RoundedTablet.h │ ├── Sphere.cpp │ ├── Sphere.h │ ├── Square.cpp │ ├── Square.h │ ├── String.cpp │ ├── String.h │ ├── Toroid.cpp │ └── Toroid.h ├── config.h.in ├── core.h ├── core │ ├── AbstractObject.cpp │ ├── AbstractObject.h │ ├── AbstractPackage.cpp │ ├── AbstractPackage.h │ ├── AbstractPart.cpp │ ├── AbstractPart.h │ ├── CMakeLists.txt │ ├── ColorDecorator.cpp │ ├── ColorDecorator.h │ ├── Component.cpp │ ├── Component.h │ ├── Component2D.h │ ├── CompositeComponent.h │ ├── CompositeObject.cpp │ ├── CompositeObject.h │ ├── CubeObject.cpp │ ├── CubeObject.h │ ├── CylinderObject.cpp │ ├── CylinderObject.h │ ├── DXFLinearExtrude.cpp │ ├── DXFLinearExtrude.h │ ├── DXFRotateExtrude.cpp │ ├── DXFRotateExtrude.h │ ├── Difference.cpp │ ├── Difference.h │ ├── Hull.cpp │ ├── Hull.h │ ├── Imported.cpp │ ├── Imported.h │ ├── IndentWriter.cpp │ ├── IndentWriter.h │ ├── Intersection.cpp │ ├── Intersection.h │ ├── LinearExtrudeDecorator.cpp │ ├── LinearExtrudeDecorator.h │ ├── Math.h │ ├── Matrix.h │ ├── MinkowskiDecorator.cpp │ ├── MinkowskiDecorator.h │ ├── MirrorDecorator.cpp │ ├── MirrorDecorator.h │ ├── ObjectDecorator.cpp │ ├── ObjectDecorator.h │ ├── Point2D.cpp │ ├── Point2D.h │ ├── Point3D.cpp │ ├── Point3D.h │ ├── PointIndexMap.h │ ├── Polygon.h │ ├── Polygon2D.cpp │ ├── Polygon2D.h │ ├── Polyhedron.cpp │ ├── Polyhedron.h │ ├── RefSys.cpp │ ├── RefSys.h │ ├── RotMatrix.cpp │ ├── RotMatrix.h │ ├── RotateExtrudeDecorator.cpp │ ├── RotateExtrudeDecorator.h │ ├── ScaleDecorator.cpp │ ├── ScaleDecorator.h │ ├── SharedPtr.h │ ├── SphereObject.cpp │ ├── SphereObject.h │ ├── TransformDecorator.cpp │ ├── TransformDecorator.h │ ├── TransformMatrix.cpp │ ├── TransformMatrix.h │ ├── Translation.h │ ├── Triangle3D.h │ ├── Union.cpp │ ├── Union.h │ ├── Vector.h │ ├── globalfunctions.cpp │ └── globalfunctions.h ├── parts.h └── parts │ ├── ArduinoUNO.cpp │ ├── ArduinoUNO.h │ ├── BallWheelHolder.cpp │ ├── BallWheelHolder.h │ ├── BatteryHolder.cpp │ ├── BatteryHolder.h │ ├── Bearings.cpp │ ├── Bearings.h │ ├── CMakeLists.txt │ ├── DummyPart.cpp │ ├── DummyPart.h │ ├── FutabaS3003.cpp │ ├── FutabaS3003.h │ ├── FutabaWheel.cpp │ ├── FutabaWheel.h │ ├── GenericServo.cpp │ ├── GenericServo.h │ ├── HCSR04.cpp │ ├── HCSR04.h │ ├── Link.cpp │ ├── Link.h │ ├── NineVoltBattery.cpp │ ├── NineVoltBattery.h │ ├── Nuts.cpp │ ├── Nuts.h │ ├── SMS4303RServo.cpp │ ├── SMS4303RServo.h │ ├── SeeedUSSensor.cpp │ ├── SeeedUSSensor.h │ ├── ServoWheel.cpp │ ├── ServoWheel.h │ ├── SharpIRSensor.cpp │ ├── SharpIRSensor.h │ ├── SimpleAxe.cpp │ ├── SimpleAxe.h │ ├── SimpleWheel.cpp │ ├── SimpleWheel.h │ ├── StepperMotors.cpp │ ├── StepperMotors.h │ ├── USSensor.cpp │ └── USSensor.h └── test ├── CMakeLists.txt ├── attachment.cpp ├── clamps.cpp ├── cube.cpp ├── prism.cpp ├── refsys.cpp ├── regular.cpp ├── rounded.cpp ├── sandbox.cpp ├── sharedptr.cpp ├── subsystem2D.cpp ├── toroid.cpp ├── transform.cpp └── writer.cpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore all bin directories 2 | bin/ 3 | # Ignore build directories 4 | build/ 5 | 6 | # Ignore lib directories 7 | lib/ 8 | 9 | # Ignore files 10 | CMakeLists.txt.user 11 | src/config.h 12 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | # Project ID. 5 | project(OOML CXX C) 6 | 7 | set(OOML_TRUNK_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 8 | # CMake Include path. 9 | set(CMAKE_MODULE_PATH "${OOML_TRUNK_DIR}/cmake") 10 | 11 | # Directory definitions. 12 | 13 | set(OOML_SRC_DIR "${OOML_TRUNK_DIR}/src") 14 | set(OOML_LIB_DIR "${OOML_TRUNK_DIR}/lib") 15 | set(OOML_BIN_DIR "${OOML_TRUNK_DIR}/bin") 16 | set(OOML_DATA_DIR "${OOML_TRUNK_DIR}/data") 17 | 18 | set(LIBRARY_OUTPUT_PATH ${OOML_LIB_DIR}) 19 | set(EXECUTABLE_OUTPUT_PATH ${OOML_BIN_DIR}) 20 | 21 | # Include directories. 22 | include_directories(${OOML_SRC_DIR}) 23 | 24 | # Link directories. 25 | link_directories(${OOML_LIB_DIR}) 26 | 27 | # Installation paths. 28 | if (WIN32) 29 | set(CMAKE_INSTALL_PREFIX "${OOML_TRUNK_DIR}") 30 | else(WIN32) 31 | set(CMAKE_INSTALL_PREFIX "/usr/") 32 | endif(WIN32) 33 | 34 | # Build flags. 35 | if (NOT WIN32) 36 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -ggdb") 37 | set(COMPILATION_FLAGS "-W -Wall -O2 -ggdb" CACHE STRING "CMake compilation flags") 38 | endif(NOT WIN32) 39 | 40 | # Build type. 41 | set(CMAKE_BUILD_TYPE "Debug") 42 | 43 | #Create Config File 44 | configure_file( ${OOML_SRC_DIR}/config.h.in ${OOML_SRC_DIR}/config.h ) 45 | 46 | # List of all project modules. 47 | add_subdirectory("src") 48 | add_subdirectory("test") 49 | add_subdirectory("data") 50 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avalero/OOML/8e333a35f23126a9b9e953b23b2faa57a9288bca/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OOML 2 | ==== 3 | 4 | C++ Object Oriented Mechanics Language 5 | 6 | What's the OOML 7 | =============== 8 | 9 | OOML stands for Object Oriented Mechanics Library. 10 | The OOML is a set of tools written in C++ that allow designers to create mechanical parts using the C++ language. 11 | * OOML applies the model of Object Oriented Programming to Mechanical Designs. 12 | * Parts can be inherited from others. A part can join together other existing parts, and so forth. 13 | * OOML has up to now no external dependency and can be used in any computer having a standard C++ compiler. 14 | 15 | Up to current version OOML generates OpenSCAD code. Using OpenSCAD designers may generate the STL of the parts. 16 | 17 | * OOML is Open Source, you can use it, modify it, share it. 18 | 19 | What's the intention of the OOML 20 | ================================ 21 | 22 | * OOML brings together both the design of pieces through code (as it's done with OpenSCAD) with the programming power 23 | of an Object Oriented Language as C++. 24 | 25 | * OOML provides a powerful tool for designers to boost their creativity building mechanical parts. 26 | * As it uses C++, designers may use any other existing C++ library to calculate, manipulate, create their parts. 27 | * OOML allow designers to create and share their own Parts Libraries, which will certainly enrich the community. 28 | 29 | Up to current version OOML generates only OpenSCAD code. We are working to generate also code for other cad programs such as FreeCad, OpenRave 30 | including a GLViewer, etc. 31 | 32 | The reason OOML exports to OpenSCAD is because we were just testing the viability of a C++ library for defining 33 | things using object oriented programming, giving semantical meaning, etc... 34 | We did not want to deal with the visualization and STL files... 35 | 36 | Now that it seems it is working we will start making a GL viewer, and generating STLs.. but that's not the real power. 37 | If the object is semantically and geometrically defined, you could theoretically make whatever you want with it... 38 | for example exporting to collada, for OpenRAVE, making stress tests... 39 | 40 | That's the idea, defining parts from their simple components and their geometrical operations. 41 | It is like Open SCAD but object oriented. -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | 2 | - What's the OOML - 3 | 4 | # OOML stands for Object Oriented Mechanics Library. The OOML is a set of tools 5 | written in C++ that allow designers to create mechanical parts using the C++ 6 | language. 7 | 8 | # OOML applies the model of Object Oriented Programming to Mechanical Designs. 9 | Parts can be inherited from others. A part can join together other existing 10 | parts, and so forth. 11 | 12 | # OOML has up to now no external dependency and can be used in any computer 13 | having a standard C++ compiler. 14 | 15 | # Up to current version OOML generates OpenSCAD code. Using OpenSCAD designers 16 | may generate the STL of the parts. 17 | 18 | # OOML is Open Source, you can use it, modify it, share it. 19 | 20 | 21 | 22 | - What's the intention of the OOML - 23 | 24 | # OOML brings together both the design of pieces through code (as it's done with 25 | OpenSCAD) with the programming power of an Object Oriented Language as C++. 26 | 27 | # OOML provides a powerful tool for designers to boost their creativity building 28 | mechanical parts. As it uses C++, designers may use any other existing C++ 29 | library to calculate, manipulate, create their parts. 30 | 31 | # OOML allow designers to create and share their own Parts Libraries, which will 32 | certainly enrich the community. 33 | 34 | # Up to current version OOML generates only OpenSCAD code. We are working to 35 | generate also code for other cad programs such as FreeCad, OpenRave, and so 36 | forth. 37 | 38 | 39 | 40 | - Building and Installing OOML - 41 | 42 | The OOML uses CMake as cross-platform, open-source build system. To build it 43 | you need to install it on your computer. Before going on install CMake. 44 | 45 | The command for doing so in Debian/Ubuntu/Mint Linux systems is: 46 | 47 | $ sudo apt-get install cmake build-essential 48 | 49 | The commands to run on the Terminal for building the OOML are: 50 | 51 | $ cd ooml $ mkdir build $ cd build $ cmake ../ $ make $ sudo make install 52 | 53 | (you need administration privileges) 54 | 55 | If you want to unistall the OOML just run from the same directory: 56 | 57 | $ sudo make uninstall 58 | 59 | (you need administration privileges too) 60 | 61 | We are assuming that your ooml code has been uncompressed into a folder called 62 | ooml. If you changed the directory name change it accordingly in the following 63 | instructions. If you prefer to run the GUI version of CMake you must choose the 64 | CMakeLists.txt file inside your ooml directory and run CMake. The compilation 65 | files generated by CMake must be saved into the/ooml/build/ directory. Then 66 | compile with the make command from terminal. 67 | -------------------------------------------------------------------------------- /changelog.txt: -------------------------------------------------------------------------------- 1 | v2.0 2 | ==== 3 | + Optimized + / * operators for avoiding unrequired nesting. 4 | + Optimized translate decorator for avoiding unrequired nesting. 5 | + 2D Shapes. 6 | + Rotate Extrude. 7 | + Minkowski Operator 8 | + Polygons 9 | + translate vs. translatedCopy 10 | + rotate vs. rotatedCopy 11 | + Mirror 12 | + Arduino UNO Part 13 | + Futaba S3003 Part 14 | + 9V Battery Part 15 | + Rotate arround one point 16 | 17 | 18 | - Scenario 19 | - Movement 20 | - Import OpenSCAD 21 | - Extrude DXF 22 | -------------------------------------------------------------------------------- /cmake/FindSubversion.cmake: -------------------------------------------------------------------------------- 1 | SET(Subversion_FOUND FALSE) 2 | SET(Subversion_SVN_FOUND FALSE) 3 | 4 | FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn 5 | DOC "subversion command line client") 6 | MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) 7 | 8 | IF(Subversion_SVN_EXECUTABLE) 9 | SET(Subversion_SVN_FOUND TRUE) 10 | SET(Subversion_FOUND TRUE) 11 | 12 | MACRO(Subversion_WC_INFO dir prefix) 13 | # the subversion commands should be executed with the C locale, otherwise 14 | # the message (which are parsed) may be translated, Alex 15 | SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}") 16 | SET(ENV{LC_ALL} C) 17 | 18 | EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version 19 | WORKING_DIRECTORY ${dir} 20 | OUTPUT_VARIABLE Subversion_VERSION_SVN 21 | OUTPUT_STRIP_TRAILING_WHITESPACE) 22 | 23 | EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir} 24 | OUTPUT_VARIABLE ${prefix}_WC_INFO 25 | ERROR_VARIABLE Subversion_svn_info_error 26 | RESULT_VARIABLE Subversion_svn_info_result 27 | OUTPUT_STRIP_TRAILING_WHITESPACE) 28 | 29 | IF(NOT ${Subversion_svn_info_result} EQUAL 0) 30 | set(Subversion_SVN_FOUND FALSE) 31 | set(Subversion_FOUND FALSE) 32 | 33 | warn("Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}") 34 | ELSE(NOT ${Subversion_svn_info_result} EQUAL 0) 35 | 36 | STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" 37 | "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") 38 | STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*" 39 | "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}") 40 | STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*" 41 | "\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}") 42 | STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*" 43 | "\\2" ${prefix}_WC_LAST_CHANGED_AUTHOR "${${prefix}_WC_INFO}") 44 | STRING(REGEX REPLACE "^(.*\n)?Last Changed Rev: ([^\n]+).*" 45 | "\\2" ${prefix}_WC_LAST_CHANGED_REV "${${prefix}_WC_INFO}") 46 | STRING(REGEX REPLACE "^(.*\n)?Last Changed Date: ([^\n]+).*" 47 | "\\2" ${prefix}_WC_LAST_CHANGED_DATE "${${prefix}_WC_INFO}") 48 | 49 | ENDIF(NOT ${Subversion_svn_info_result} EQUAL 0) 50 | 51 | # restore the previous LC_ALL 52 | SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL}) 53 | 54 | ENDMACRO(Subversion_WC_INFO) 55 | ENDIF(Subversion_SVN_EXECUTABLE) 56 | 57 | -------------------------------------------------------------------------------- /cmake/runtest.cmake: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | function(simple_test TEST_NAME) 5 | add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME}) 6 | endfunction(simple_test TEST_NAME) 7 | -------------------------------------------------------------------------------- /cmake/vcs-revision.cmake: -------------------------------------------------------------------------------- 1 | IF (EXISTS ${PROJECT_SOURCE_DIR}/.svn) 2 | INCLUDE(${CMAKE_MODULE_PATH}/FindSubversion.cmake) 3 | IF(Subversion_FOUND) 4 | Subversion_WC_INFO(${PROJECT_SOURCE_DIR} PROJECT) 5 | # Workaround for wrong retrieved information 6 | STRING(LENGTH ${PROJECT_WC_REVISION} tmpSVNINFO) 7 | IF(${tmpSVNINFO} GREATER 10) 8 | SET(PROJECT_WC_REVISION "0") 9 | ENDIF(${tmpSVNINFO} GREATER 10) 10 | string(REGEX MATCH ".*/openrdk/branches/.*" __is_branch ${PROJECT_WC_URL}) 11 | set(PROJECT_CODENAME "trunk") 12 | if (NOT "x${__is_branch}" STREQUAL "x") 13 | string(REGEX REPLACE ".*/([^/]*)" "\\1" __dirname ${PROJECT_SOURCE_DIR}) 14 | string(REGEX REPLACE ".*/openrdk/branches/.*-(.*)/${__dirname}" "\\1" PROJECT_CODENAME ${__is_branch}) 15 | endif (NOT "x${__is_branch}" STREQUAL "x") 16 | ENDIF(Subversion_FOUND) 17 | ENDIF (EXISTS ${PROJECT_SOURCE_DIR}/.svn) 18 | 19 | MESSAGE(STATUS "-- Current SVN revision is ${PROJECT_WC_REVISION} (codename: ${PROJECT_CODENAME})") 20 | 21 | -------------------------------------------------------------------------------- /data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | file(GLOB DXFS "./dxf/*.dxf") 5 | install(FILES ${DXFS} DESTINATION include/ooml/data/dxf) 6 | -------------------------------------------------------------------------------- /data/dxf/1.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | -50.6717171717172 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -50.6717171717172 17 | 21 18 | 18.9858585858586 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -50.6717171717172 27 | 20 28 | 18.9858585858586 29 | 30 30 | 0.0 31 | 11 32 | -12.7 33 | 21 34 | 18.9858585858586 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -12.7 43 | 20 44 | 18.9858585858586 45 | 30 46 | 0.0 47 | 11 48 | -12.7 49 | 21 50 | 168.820202020202 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -12.7 59 | 20 60 | 168.820202020202 61 | 30 62 | 0.0 63 | 11 64 | -50.6717171717172 65 | 21 66 | 159.327272727273 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -50.6717171717172 75 | 20 76 | 159.327272727273 77 | 30 78 | 0.0 79 | 11 80 | -50.6717171717172 81 | 21 82 | 178.826262626263 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -50.6717171717172 91 | 20 92 | 178.826262626263 93 | 30 94 | 0.0 95 | 11 96 | 12.7 97 | 21 98 | 194.605050505051 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | 12.7 107 | 20 108 | 194.605050505051 109 | 30 110 | 0.0 111 | 11 112 | 12.7 113 | 21 114 | 18.9858585858586 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 12.7 123 | 20 124 | 18.9858585858586 125 | 30 126 | 0.0 127 | 11 128 | 50.6717171717172 129 | 21 130 | 18.9858585858586 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 50.6717171717172 139 | 20 140 | 18.9858585858586 141 | 30 142 | 0.0 143 | 11 144 | 50.6717171717172 145 | 21 146 | 0.0 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 50.6717171717172 155 | 20 156 | 0.0 157 | 30 158 | 0.0 159 | 11 160 | -50.6717171717172 161 | 21 162 | 0.0 163 | 31 164 | 0.0 165 | 0 166 | ENDSEC 167 | 0 168 | EOF 169 | -------------------------------------------------------------------------------- /data/dxf/7.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | -49.9020202020202 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -45.396089651127 17 | 21 18 | 20.6856131563283 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -45.396089651127 27 | 20 28 | 20.6856131563283 29 | 30 30 | 0.0 31 | 11 32 | -39.3186868686869 33 | 21 34 | 38.3565656565657 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -39.3186868686869 43 | 20 44 | 38.3565656565657 45 | 30 46 | 0.0 47 | 11 48 | -15.0090909090909 49 | 21 50 | 82.7424242424242 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -15.0090909090909 59 | 20 60 | 82.7424242424242 61 | 30 62 | 0.0 63 | 11 64 | 36.8171717171717 65 | 21 66 | 166.126262626263 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | 36.8171717171717 75 | 20 76 | 166.126262626263 77 | 30 78 | 0.0 79 | 11 80 | -60.9343434343434 81 | 21 82 | 166.126262626263 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -60.9343434343434 91 | 20 92 | 166.126262626263 93 | 30 94 | 0.0 95 | 11 96 | -60.9343434343434 97 | 21 98 | 189.858585858586 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -60.9343434343434 107 | 20 108 | 189.858585858586 109 | 30 110 | 0.0 111 | 11 112 | 60.9343434343434 113 | 21 114 | 189.858585858586 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 60.9343434343434 123 | 20 124 | 189.858585858586 125 | 30 126 | 0.0 127 | 11 128 | 60.9343434343434 129 | 21 130 | 166.126262626263 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 60.9343434343434 139 | 20 140 | 166.126262626263 141 | 30 142 | 0.0 143 | 11 144 | 28.4546375881542 145 | 21 146 | 115.382263044877 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 28.4546375881542 155 | 20 156 | 115.382263044877 157 | 30 158 | 0.0 159 | 11 160 | 4.00875910749339 161 | 21 162 | 70.7799898243914 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 4.00875910749339 171 | 20 172 | 70.7799898243914 173 | 30 174 | 0.0 175 | 11 176 | -12.4033676137828 177 | 21 178 | 32.3192873482752 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | -12.4033676137828 187 | 20 188 | 32.3192873482752 189 | 30 190 | 0.0 191 | 11 192 | -20.7818181818182 193 | 21 194 | 0.0 195 | 31 196 | 0.0 197 | 0 198 | LINE 199 | 8 200 | COMPONENT0 201 | 10 202 | -20.7818181818182 203 | 20 204 | 0.0 205 | 30 206 | 0.0 207 | 11 208 | -49.9020202020202 209 | 21 210 | 0.0 211 | 31 212 | 0.0 213 | 0 214 | ENDSEC 215 | 0 216 | EOF 217 | -------------------------------------------------------------------------------- /data/dxf/A.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 83.1452161243322 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | 57.1160757649344 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 57.1160757649344 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | 39.1053909664886 33 | 21 34 | 51.1947547353084 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 39.1053909664886 43 | 20 44 | 51.1947547353084 45 | 30 46 | 0.0 47 | 11 48 | -40.3389995143273 49 | 21 50 | 51.1947547353084 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -40.3389995143273 59 | 20 60 | 51.1947547353084 61 | 30 62 | 0.0 63 | 11 64 | -58.3496843127732 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -58.3496843127732 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -83.1452161243322 81 | 21 82 | 0.0 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -83.1452161243322 91 | 20 92 | 0.0 93 | 30 94 | 0.0 95 | 11 96 | -16.2836328314716 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -16.2836328314716 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 16.2836328314716 113 | 21 114 | 183.684312773191 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 16.2836328314716 123 | 20 124 | 183.684312773191 125 | 30 126 | 0.0 127 | 11 128 | 83.1452161243322 129 | 21 130 | 0.0 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 31.5803788246722 139 | 20 140 | 72.1661000485673 141 | 30 142 | 0.0 143 | 11 144 | -0.616804273919382 145 | 21 146 | 162.34288489558 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | -0.616804273919382 155 | 20 156 | 162.34288489558 157 | 30 158 | 0.0 159 | 11 160 | -32.9373482272948 161 | 21 162 | 72.1661000485673 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | -32.9373482272948 171 | 20 172 | 72.1661000485673 173 | 30 174 | 0.0 175 | 11 176 | 31.5803788246722 177 | 21 178 | 72.1661000485673 179 | 31 180 | 0.0 181 | 0 182 | ENDSEC 183 | 0 184 | EOF 185 | -------------------------------------------------------------------------------- /data/dxf/E.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 60.508499271491 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -60.508499271491 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -60.508499271491 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -60.508499271491 33 | 21 34 | 183.684312773191 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -60.508499271491 43 | 20 44 | 183.684312773191 45 | 30 46 | 0.0 47 | 11 48 | 60.508499271491 49 | 21 50 | 183.684312773191 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 60.508499271491 59 | 20 60 | 183.684312773191 61 | 30 62 | 0.0 63 | 11 64 | 60.508499271491 65 | 21 66 | 161.972802331229 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | 60.508499271491 75 | 20 76 | 161.972802331229 77 | 30 78 | 0.0 79 | 11 80 | -36.0830500242836 81 | 21 82 | 161.972802331229 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -36.0830500242836 91 | 20 92 | 161.972802331229 93 | 30 94 | 0.0 95 | 11 96 | -36.0830500242836 97 | 21 98 | 111.641573579407 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -36.0830500242836 107 | 20 108 | 111.641573579407 109 | 30 110 | 0.0 111 | 11 112 | 60.508499271491 113 | 21 114 | 111.641573579407 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 60.508499271491 123 | 20 124 | 111.641573579407 125 | 30 126 | 0.0 127 | 11 128 | 60.508499271491 129 | 21 130 | 89.9300631374453 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 60.508499271491 139 | 20 140 | 89.9300631374453 141 | 30 142 | 0.0 143 | 11 144 | -36.0830500242836 145 | 21 146 | 89.9300631374453 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | -36.0830500242836 155 | 20 156 | 89.9300631374453 157 | 30 158 | 0.0 159 | 11 160 | -36.0830500242836 161 | 21 162 | 21.7115104419621 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | -36.0830500242836 171 | 20 172 | 21.7115104419621 173 | 30 174 | 0.0 175 | 11 176 | 60.508499271491 177 | 21 178 | 21.7115104419621 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 60.508499271491 187 | 20 188 | 21.7115104419621 189 | 30 190 | 0.0 191 | 11 192 | 60.508499271491 193 | 21 194 | 0.0 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/F.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 58.6580864497329 11 | 20 12 | 161.972802331229 13 | 30 14 | 0.0 15 | 11 16 | -34.2326372025255 17 | 21 18 | 161.972802331229 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -34.2326372025255 27 | 20 28 | 161.972802331229 29 | 30 30 | 0.0 31 | 11 32 | -34.2326372025255 33 | 21 34 | 110.161243322001 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -34.2326372025255 43 | 20 44 | 110.161243322001 45 | 30 46 | 0.0 47 | 11 48 | 45.581835842642 49 | 21 50 | 110.161243322001 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 45.581835842642 59 | 20 60 | 110.161243322001 61 | 30 62 | 0.0 63 | 11 64 | 45.581835842642 65 | 21 66 | 88.4497328800388 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | 45.581835842642 75 | 20 76 | 88.4497328800388 77 | 30 78 | 0.0 79 | 11 80 | -34.2326372025255 81 | 21 82 | 88.4497328800388 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -34.2326372025255 91 | 20 92 | 88.4497328800388 93 | 30 94 | 0.0 95 | 11 96 | -34.2326372025255 97 | 21 98 | 0.0 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -34.2326372025255 107 | 20 108 | 0.0 109 | 30 110 | 0.0 111 | 11 112 | -58.6580864497329 113 | 21 114 | 0.0 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -58.6580864497329 123 | 20 124 | 0.0 125 | 30 126 | 0.0 127 | 11 128 | -58.6580864497329 129 | 21 130 | 183.684312773191 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -58.6580864497329 139 | 20 140 | 183.684312773191 141 | 30 142 | 0.0 143 | 11 144 | 58.6580864497329 145 | 21 146 | 183.684312773191 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 58.6580864497329 155 | 20 156 | 183.684312773191 157 | 30 158 | 0.0 159 | 11 160 | 58.6580864497329 161 | 21 162 | 161.972802331229 163 | 31 164 | 0.0 165 | 0 166 | ENDSEC 167 | 0 168 | EOF 169 | -------------------------------------------------------------------------------- /data/dxf/H.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 70.2540067994172 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | 45.8285575522098 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 45.8285575522098 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | 45.8285575522098 33 | 21 34 | 89.9300631374453 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 45.8285575522098 43 | 20 44 | 89.9300631374453 45 | 30 46 | 0.0 47 | 11 48 | -45.8285575522098 49 | 21 50 | 89.9300631374453 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -45.8285575522098 59 | 20 60 | 89.9300631374453 61 | 30 62 | 0.0 63 | 11 64 | -45.8285575522098 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -45.8285575522098 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -70.2540067994172 81 | 21 82 | 0.0 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -70.2540067994172 91 | 20 92 | 0.0 93 | 30 94 | 0.0 95 | 11 96 | -70.2540067994172 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -70.2540067994172 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | -45.8285575522098 113 | 21 114 | 183.684312773191 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -45.8285575522098 123 | 20 124 | 183.684312773191 125 | 30 126 | 0.0 127 | 11 128 | -45.8285575522098 129 | 21 130 | 111.641573579407 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -45.8285575522098 139 | 20 140 | 111.641573579407 141 | 30 142 | 0.0 143 | 11 144 | 45.8285575522098 145 | 21 146 | 111.641573579407 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 45.8285575522098 155 | 20 156 | 111.641573579407 157 | 30 158 | 0.0 159 | 11 160 | 45.8285575522098 161 | 21 162 | 183.684312773191 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 45.8285575522098 171 | 20 172 | 183.684312773191 173 | 30 174 | 0.0 175 | 11 176 | 70.2540067994172 177 | 21 178 | 183.684312773191 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 70.2540067994172 187 | 20 188 | 183.684312773191 189 | 30 190 | 0.0 191 | 11 192 | 70.2540067994172 193 | 21 194 | 0.0 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/I.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 36.2680913064594 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -36.2680913064594 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -36.2680913064594 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -36.2680913064594 33 | 21 34 | 18.7508499271491 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -36.2680913064594 43 | 20 44 | 18.7508499271491 45 | 30 46 | 0.0 47 | 11 48 | -12.2127246236037 49 | 21 50 | 18.7508499271491 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -12.2127246236037 59 | 20 60 | 18.7508499271491 61 | 30 62 | 0.0 63 | 11 64 | -12.2127246236037 65 | 21 66 | 164.933462846042 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -12.2127246236037 75 | 20 76 | 164.933462846042 77 | 30 78 | 0.0 79 | 11 80 | -36.2680913064594 81 | 21 82 | 164.933462846042 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -36.2680913064594 91 | 20 92 | 164.933462846042 93 | 30 94 | 0.0 95 | 11 96 | -36.2680913064594 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -36.2680913064594 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 36.2680913064594 113 | 21 114 | 183.684312773191 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 36.2680913064594 123 | 20 124 | 183.684312773191 125 | 30 126 | 0.0 127 | 11 128 | 36.2680913064594 129 | 21 130 | 164.933462846042 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 36.2680913064594 139 | 20 140 | 164.933462846042 141 | 30 142 | 0.0 143 | 11 144 | 12.2127246236037 145 | 21 146 | 164.933462846042 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 12.2127246236037 155 | 20 156 | 164.933462846042 157 | 30 158 | 0.0 159 | 11 160 | 12.2127246236037 161 | 21 162 | 18.7508499271491 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 12.2127246236037 171 | 20 172 | 18.7508499271491 173 | 30 174 | 0.0 175 | 11 176 | 36.2680913064594 177 | 21 178 | 18.7508499271491 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 36.2680913064594 187 | 20 188 | 18.7508499271491 189 | 30 190 | 0.0 191 | 11 192 | 36.2680913064594 193 | 21 194 | 0.0 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/K.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 73.0346110388243 11 | 20 12 | -0.0084992744386677 13 | 30 14 | 0.0 15 | 11 16 | 41.3308713593682 17 | 21 18 | -0.0084992744386677 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 41.3308713593682 27 | 20 28 | -0.0084992744386677 29 | 30 30 | 0.0 31 | 11 32 | -31.3286721083346 33 | 21 34 | 81.7797474472709 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -31.3286721083346 43 | 20 44 | 81.7797474472709 45 | 30 46 | 0.0 47 | 11 48 | -49.5860786163482 49 | 21 50 | 62.2887323914185 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -49.5860786163482 59 | 20 60 | 62.2887323914185 61 | 30 62 | 0.0 63 | 11 64 | -49.5860786163482 65 | 21 66 | -0.0084992744386677 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -49.5860786163482 75 | 20 76 | -0.0084992744386677 77 | 30 78 | 0.0 79 | 11 80 | -74.0115278635555 81 | 21 82 | -0.0084992744386677 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -74.0115278635555 91 | 20 92 | -0.0084992744386677 93 | 30 94 | 0.0 95 | 11 96 | -74.0115278635555 97 | 21 98 | 183.675813498752 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -74.0115278635555 107 | 20 108 | 183.675813498752 109 | 30 110 | 0.0 111 | 11 112 | -49.5860786163482 113 | 21 114 | 183.675813498752 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -49.5860786163482 123 | 20 124 | 183.675813498752 125 | 30 126 | 0.0 127 | 11 128 | -49.5860786163482 129 | 21 130 | 87.8244293316808 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -49.5860786163482 139 | 20 140 | 87.8244293316808 141 | 30 142 | 0.0 143 | 11 144 | 39.6038193923939 145 | 21 146 | 183.675813498752 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 39.6038193923939 155 | 20 156 | 183.675813498752 157 | 30 158 | 0.0 159 | 11 160 | 69.2104245405241 161 | 21 162 | 183.675813498752 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 69.2104245405241 171 | 20 172 | 183.675813498752 173 | 30 174 | 0.0 175 | 11 176 | -12.8245438907532 177 | 21 178 | 97.3232151500392 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | -12.8245438907532 187 | 20 188 | 97.3232151500392 189 | 30 190 | 0.0 191 | 11 192 | 73.0346110388243 193 | 21 194 | -0.0084992744386677 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/L.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 58.1029626032054 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -58.1029626032054 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -58.1029626032054 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -58.1029626032054 33 | 21 34 | 183.684312773191 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -58.1029626032054 43 | 20 44 | 183.684312773191 45 | 30 46 | 0.0 47 | 11 48 | -33.6775133559981 49 | 21 50 | 183.684312773191 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -33.6775133559981 59 | 20 60 | 183.684312773191 61 | 30 62 | 0.0 63 | 11 64 | -33.6775133559981 65 | 21 66 | 21.7115104419621 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -33.6775133559981 75 | 20 76 | 21.7115104419621 77 | 30 78 | 0.0 79 | 11 80 | 58.1029626032054 81 | 21 82 | 21.7115104419621 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | 58.1029626032054 91 | 20 92 | 21.7115104419621 93 | 30 94 | 0.0 95 | 11 96 | 58.1029626032054 97 | 21 98 | 0.0 99 | 31 100 | 0.0 101 | 0 102 | ENDSEC 103 | 0 104 | EOF 105 | -------------------------------------------------------------------------------- /data/dxf/M.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 81.7882467217096 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | 57.3627974745022 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 57.3627974745022 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | 57.3627974745022 33 | 21 34 | 158.271976687712 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 57.3627974745022 43 | 20 44 | 158.271976687712 45 | 30 46 | 0.0 47 | 11 48 | 6.29140359397766 49 | 21 50 | 50.577950461389 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 6.29140359397766 59 | 20 60 | 50.577950461389 61 | 30 62 | 0.0 63 | 11 64 | -8.26517727051966 65 | 21 66 | 50.577950461389 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -8.26517727051966 75 | 20 76 | 50.577950461389 77 | 30 78 | 0.0 79 | 11 80 | -58.9664885866926 81 | 21 82 | 158.271976687712 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -58.9664885866926 91 | 20 92 | 158.271976687712 93 | 30 94 | 0.0 95 | 11 96 | -58.9664885866926 97 | 21 98 | 0.0 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -58.9664885866926 107 | 20 108 | 0.0 109 | 30 110 | 0.0 111 | 11 112 | -81.7882467217096 113 | 21 114 | 0.0 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -81.7882467217096 123 | 20 124 | 0.0 125 | 30 126 | 0.0 127 | 11 128 | -81.7882467217096 129 | 21 130 | 183.684312773191 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -81.7882467217096 139 | 20 140 | 183.684312773191 141 | 30 142 | 0.0 143 | 11 144 | -48.4808159300631 145 | 21 146 | 183.684312773191 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | -48.4808159300631 155 | 20 156 | 183.684312773191 157 | 30 158 | 0.0 159 | 11 160 | 0.493443419135503 161 | 21 162 | 81.4181641573579 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 0.493443419135503 171 | 20 172 | 81.4181641573579 173 | 30 174 | 0.0 175 | 11 176 | 47.8640116561438 177 | 21 178 | 183.684312773191 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 47.8640116561438 187 | 20 188 | 183.684312773191 189 | 30 190 | 0.0 191 | 11 192 | 81.7882467217096 193 | 21 194 | 183.684312773191 195 | 31 196 | 0.0 197 | 0 198 | LINE 199 | 8 200 | COMPONENT0 201 | 10 202 | 81.7882467217096 203 | 20 204 | 183.684312773191 205 | 30 206 | 0.0 207 | 11 208 | 81.7882467217096 209 | 21 210 | 0.0 211 | 31 212 | 0.0 213 | 0 214 | ENDSEC 215 | 0 216 | EOF 217 | -------------------------------------------------------------------------------- /data/dxf/N.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 70.0689655172414 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | 39.8455560951918 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 39.8455560951918 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -47.2472073822244 33 | 21 34 | 164.316658572122 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -47.2472073822244 43 | 20 44 | 164.316658572122 45 | 30 46 | 0.0 47 | 11 48 | -47.2472073822244 49 | 21 50 | 0.0 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -47.2472073822244 59 | 20 60 | 0.0 61 | 30 62 | 0.0 63 | 11 64 | -70.0689655172414 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -70.0689655172414 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -70.0689655172414 81 | 21 82 | 183.684312773191 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -70.0689655172414 91 | 20 92 | 183.684312773191 93 | 30 94 | 0.0 95 | 11 96 | -32.1971830985915 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -32.1971830985915 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 47.2472073822244 113 | 21 114 | 33.6775133559981 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 47.2472073822244 123 | 20 124 | 33.6775133559981 125 | 30 126 | 0.0 127 | 11 128 | 47.2472073822244 129 | 21 130 | 183.684312773191 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 47.2472073822244 139 | 20 140 | 183.684312773191 141 | 30 142 | 0.0 143 | 11 144 | 70.0689655172414 145 | 21 146 | 183.684312773191 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 70.0689655172414 155 | 20 156 | 183.684312773191 157 | 30 158 | 0.0 159 | 11 160 | 70.0689655172414 161 | 21 162 | 0.0 163 | 31 164 | 0.0 165 | 0 166 | ENDSEC 167 | 0 168 | EOF 169 | -------------------------------------------------------------------------------- /data/dxf/T.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 77.8406993686255 11 | 20 12 | 161.972802331229 13 | 30 14 | 0.0 15 | 11 16 | 12.2127246236037 17 | 21 18 | 161.972802331229 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 12.2127246236037 27 | 20 28 | 161.972802331229 29 | 30 30 | 0.0 31 | 11 32 | 12.2127246236037 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 12.2127246236037 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | -12.2127246236037 49 | 21 50 | 0.0 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -12.2127246236037 59 | 20 60 | 0.0 61 | 30 62 | 0.0 63 | 11 64 | -12.2127246236037 65 | 21 66 | 161.972802331229 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -12.2127246236037 75 | 20 76 | 161.972802331229 77 | 30 78 | 0.0 79 | 11 80 | -77.8406993686255 81 | 21 82 | 161.972802331229 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -77.8406993686255 91 | 20 92 | 161.972802331229 93 | 30 94 | 0.0 95 | 11 96 | -77.8406993686255 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -77.8406993686255 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 77.8406993686255 113 | 21 114 | 183.684312773191 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 77.8406993686255 123 | 20 124 | 183.684312773191 125 | 30 126 | 0.0 127 | 11 128 | 77.8406993686255 129 | 21 130 | 161.972802331229 131 | 31 132 | 0.0 133 | 0 134 | ENDSEC 135 | 0 136 | EOF 137 | -------------------------------------------------------------------------------- /data/dxf/V.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 83.1452161243322 11 | 20 12 | 183.684312773191 13 | 30 14 | 0.0 15 | 11 16 | 16.2836328314716 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 16.2836328314716 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -16.2836328314716 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -16.2836328314716 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | -83.1452161243322 49 | 21 50 | 183.684312773191 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -83.1452161243322 59 | 20 60 | 183.684312773191 61 | 30 62 | 0.0 63 | 11 64 | -56.9927149101506 65 | 21 66 | 183.684312773191 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -56.9927149101506 75 | 20 76 | 183.684312773191 77 | 30 78 | 0.0 79 | 11 80 | 0.61680427391937 81 | 21 82 | 22.0815930063137 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | 0.61680427391937 91 | 20 92 | 22.0815930063137 93 | 30 94 | 0.0 95 | 11 96 | 58.2263234579893 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | 58.2263234579893 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 83.1452161243322 113 | 21 114 | 183.684312773191 115 | 31 116 | 0.0 117 | 0 118 | ENDSEC 119 | 0 120 | EOF 121 | -------------------------------------------------------------------------------- /data/dxf/W.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 113.553666828558 11 | 20 12 | 183.684312773191 13 | 30 14 | 0.0 15 | 11 16 | 65.8130160271977 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 65.8130160271977 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | 38.3035454103934 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 38.3035454103934 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | -0.308402136959685 49 | 21 50 | 152.47401651287 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -0.308402136959685 59 | 20 60 | 152.47401651287 61 | 30 62 | 0.0 63 | 11 64 | -38.0568237008256 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -38.0568237008256 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -64.9494900437105 81 | 21 82 | 0.0 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -64.9494900437105 91 | 20 92 | 0.0 93 | 30 94 | 0.0 95 | 11 96 | -113.553666828558 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -113.553666828558 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | -88.5114133074308 113 | 21 114 | 183.684312773191 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -88.5114133074308 123 | 20 124 | 183.684312773191 125 | 30 126 | 0.0 127 | 11 128 | -49.8994657600777 129 | 21 130 | 30.9635745507528 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -49.8994657600777 139 | 20 140 | 30.9635745507528 141 | 30 142 | 0.0 143 | 11 144 | -11.904322486644 145 | 21 146 | 183.684312773191 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | -11.904322486644 155 | 20 156 | 183.684312773191 157 | 30 158 | 0.0 159 | 11 160 | 12.891209324915 161 | 21 162 | 183.684312773191 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 12.891209324915 171 | 20 172 | 183.684312773191 173 | 30 174 | 0.0 175 | 11 176 | 51.2564351627003 177 | 21 178 | 29.4832442933463 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 51.2564351627003 187 | 20 188 | 29.4832442933463 189 | 30 190 | 0.0 191 | 11 192 | 89.6216610004857 193 | 21 194 | 183.684312773191 195 | 31 196 | 0.0 197 | 0 198 | LINE 199 | 8 200 | COMPONENT0 201 | 10 202 | 89.6216610004857 203 | 20 204 | 183.684312773191 205 | 30 206 | 0.0 207 | 11 208 | 113.553666828558 209 | 21 210 | 183.684312773191 211 | 31 212 | 0.0 213 | 0 214 | ENDSEC 215 | 0 216 | EOF 217 | -------------------------------------------------------------------------------- /data/dxf/X.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 78.2107819329772 11 | 20 12 | 183.684312773191 13 | 30 14 | 0.0 15 | 11 16 | 14.8033025740651 17 | 21 18 | 92.8907236522584 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 14.8033025740651 27 | 20 28 | 92.8907236522584 29 | 30 30 | 0.0 31 | 11 32 | 78.0874210781933 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 78.0874210781933 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | 49.8377853326858 49 | 21 50 | 0.0 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 49.8377853326858 59 | 20 60 | 0.0 61 | 30 62 | 0.0 63 | 11 64 | -0.246721709567746 65 | 21 66 | 75.6202039825158 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -0.246721709567746 75 | 20 76 | 75.6202039825158 77 | 30 78 | 0.0 79 | 11 80 | -51.56483729966 81 | 21 82 | 0.0 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -51.56483729966 91 | 20 92 | 0.0 93 | 30 94 | 0.0 95 | 11 96 | -78.2107819329772 97 | 21 98 | 0.0 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -78.2107819329772 107 | 20 108 | 0.0 109 | 30 110 | 0.0 111 | 11 112 | -14.1864983001457 113 | 21 114 | 91.7804759592035 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -14.1864983001457 123 | 20 124 | 91.7804759592035 125 | 30 126 | 0.0 127 | 11 128 | -76.7304516755706 129 | 21 130 | 183.684312773191 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -76.7304516755706 139 | 20 140 | 183.684312773191 141 | 30 142 | 0.0 143 | 11 144 | -48.604176784847 145 | 21 146 | 183.684312773191 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | -48.604176784847 155 | 20 156 | 183.684312773191 157 | 30 158 | 0.0 159 | 11 160 | 0.863525983487128 161 | 21 162 | 109.050995628946 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 0.863525983487128 171 | 20 172 | 109.050995628946 173 | 30 174 | 0.0 175 | 11 176 | 51.4414764448761 177 | 21 178 | 183.684312773191 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 51.4414764448761 187 | 20 188 | 183.684312773191 189 | 30 190 | 0.0 191 | 11 192 | 78.2107819329772 193 | 21 194 | 183.684312773191 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/Y.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 76.9771733851384 11 | 20 12 | 183.684312773191 13 | 30 14 | 0.0 15 | 11 16 | 12.3360854783876 17 | 21 18 | 80.5546381738708 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 12.3360854783876 27 | 20 28 | 80.5546381738708 29 | 30 30 | 0.0 31 | 11 32 | 12.3360854783876 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 12.3360854783876 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | -12.0893637688198 49 | 21 50 | 0.0 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -12.0893637688198 59 | 20 60 | 0.0 61 | 30 62 | 0.0 63 | 11 64 | -12.0893637688198 65 | 21 66 | 77.9640602234094 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -12.0893637688198 75 | 20 76 | 77.9640602234094 77 | 30 78 | 0.0 79 | 11 80 | -76.9771733851384 81 | 21 82 | 183.684312773191 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -76.9771733851384 91 | 20 92 | 183.684312773191 93 | 30 94 | 0.0 95 | 11 96 | -49.9611461874696 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -49.9611461874696 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 0.246721709567746 113 | 21 114 | 101.52598348713 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 0.246721709567746 123 | 20 124 | 101.52598348713 125 | 30 126 | 0.0 127 | 11 128 | 50.9480330257406 129 | 21 130 | 183.684312773191 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 50.9480330257406 139 | 20 140 | 183.684312773191 141 | 30 142 | 0.0 143 | 11 144 | 76.9771733851384 145 | 21 146 | 183.684312773191 147 | 31 148 | 0.0 149 | 0 150 | ENDSEC 151 | 0 152 | EOF 153 | -------------------------------------------------------------------------------- /data/dxf/Z.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 71.6726566294318 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -71.6726566294318 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -71.6726566294318 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -71.6726566294318 33 | 21 34 | 22.6983972802331 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -71.6726566294318 43 | 20 44 | 22.6983972802331 45 | 30 46 | 0.0 47 | 11 48 | 40.9558037882467 49 | 21 50 | 161.972802331229 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 40.9558037882467 59 | 20 60 | 161.972802331229 61 | 30 62 | 0.0 63 | 11 64 | -67.47838756678 65 | 21 66 | 161.972802331229 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -67.47838756678 75 | 20 76 | 161.972802331229 77 | 30 78 | 0.0 79 | 11 80 | -67.47838756678 81 | 21 82 | 183.684312773191 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -67.47838756678 91 | 20 92 | 183.684312773191 93 | 30 94 | 0.0 95 | 11 96 | 68.9587178241865 97 | 21 98 | 183.684312773191 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | 68.9587178241865 107 | 20 108 | 183.684312773191 109 | 30 110 | 0.0 111 | 11 112 | 68.9587178241865 113 | 21 114 | 161.602719766877 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 68.9587178241865 123 | 20 124 | 161.602719766877 125 | 30 126 | 0.0 127 | 11 128 | -44.7799902865469 129 | 21 130 | 21.7115104419621 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -44.7799902865469 139 | 20 140 | 21.7115104419621 141 | 30 142 | 0.0 143 | 11 144 | 71.6726566294318 145 | 21 146 | 21.7115104419621 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 71.6726566294318 155 | 20 156 | 21.7115104419621 157 | 30 158 | 0.0 159 | 11 160 | 71.6726566294318 161 | 21 162 | 0.0 163 | 31 164 | 0.0 165 | 0 166 | ENDSEC 167 | 0 168 | EOF 169 | -------------------------------------------------------------------------------- /data/dxf/im.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 13.0762506070908 11 | 20 12 | 160.862554638174 13 | 30 14 | 0.0 15 | 11 16 | -13.0762506070908 17 | 21 18 | 160.862554638174 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -13.0762506070908 27 | 20 28 | 160.862554638174 29 | 30 30 | 0.0 31 | 11 32 | -13.0762506070908 33 | 21 34 | 184.91792132103 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -13.0762506070908 43 | 20 44 | 184.91792132103 45 | 30 46 | 0.0 47 | 11 48 | 13.0762506070908 49 | 21 50 | 184.91792132103 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 13.0762506070908 59 | 20 60 | 184.91792132103 61 | 30 62 | 0.0 63 | 11 64 | 13.0762506070908 65 | 21 66 | 160.862554638174 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | 11.5959203496843 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -11.5959203496843 81 | 21 82 | 0.0 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -11.5959203496843 91 | 20 92 | 0.0 93 | 30 94 | 0.0 95 | 11 96 | -11.5959203496843 97 | 21 98 | 137.794074793589 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -11.5959203496843 107 | 20 108 | 137.794074793589 109 | 30 110 | 0.0 111 | 11 112 | 11.5959203496843 113 | 21 114 | 137.794074793589 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 11.5959203496843 123 | 20 124 | 137.794074793589 125 | 30 126 | 0.0 127 | 11 128 | 11.5959203496843 129 | 21 130 | 0.0 131 | 31 132 | 0.0 133 | 0 134 | ENDSEC 135 | 0 136 | EOF 137 | -------------------------------------------------------------------------------- /data/dxf/km.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 61.3269758053995 11 | 20 12 | 0.564368441854178 13 | 30 14 | 0.0 15 | 11 16 | 30.7334838189983 17 | 21 18 | 0.564368441854178 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 30.7334838189983 27 | 20 28 | 0.564368441854178 29 | 30 30 | 0.0 31 | 11 32 | -24.532179124178 33 | 21 34 | 60.8878264311694 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -24.532179124178 43 | 20 44 | 60.8878264311694 45 | 30 46 | 0.0 47 | 11 48 | -39.5822034078108 49 | 21 50 | 46.5779672762398 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -39.5822034078108 59 | 20 60 | 46.5779672762398 61 | 30 62 | 0.0 63 | 11 64 | -39.5822034078108 65 | 21 66 | 0.564368441854178 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -39.5822034078108 75 | 20 76 | 0.564368441854178 77 | 30 78 | 0.0 79 | 11 80 | -62.7740441071794 81 | 21 82 | 0.564368441854178 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -62.7740441071794 91 | 20 92 | 0.564368441854178 93 | 30 94 | 0.0 95 | 11 96 | -62.7740441071794 97 | 21 98 | 192.513858485565 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -62.7740441071794 107 | 20 108 | 192.513858485565 109 | 30 110 | 0.0 111 | 11 112 | -39.5822034078108 113 | 21 114 | 192.513858485565 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -39.5822034078108 123 | 20 124 | 192.513858485565 125 | 30 126 | 0.0 127 | 11 128 | -39.5822034078108 129 | 21 130 | 69.3997254112568 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -39.5822034078108 139 | 20 140 | 69.3997254112568 141 | 30 142 | 0.0 143 | 11 144 | 27.4027407398337 145 | 21 146 | 138.358443235443 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 27.4027407398337 155 | 20 156 | 138.358443235443 157 | 30 158 | 0.0 159 | 11 160 | 56.6392633236122 161 | 21 162 | 138.358443235443 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 56.6392633236122 171 | 20 172 | 138.358443235443 173 | 30 174 | 0.0 175 | 11 176 | -7.38502030921928 177 | 21 178 | 74.7042421669635 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | -7.38502030921928 187 | 20 188 | 74.7042421669635 189 | 30 190 | 0.0 191 | 11 192 | 61.3269758053995 193 | 21 194 | 0.564368441854178 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/lm.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 11.5959203496843 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -11.5959203496843 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -11.5959203496843 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -11.5959203496843 33 | 21 34 | 191.949490043711 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -11.5959203496843 43 | 20 44 | 191.949490043711 45 | 30 46 | 0.0 47 | 11 48 | 11.5959203496843 49 | 21 50 | 191.949490043711 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 11.5959203496843 59 | 20 60 | 191.949490043711 61 | 30 62 | 0.0 63 | 11 64 | 11.5959203496843 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | ENDSEC 71 | 0 72 | EOF 73 | -------------------------------------------------------------------------------- /data/dxf/vm.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 67.2316658572122 11 | 20 12 | 137.794074793589 13 | 30 14 | 0.0 15 | 11 16 | 11.4725594949004 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 11.4725594949004 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -11.8426420592521 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -11.8426420592521 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | -67.2316658572122 49 | 21 50 | 137.794074793589 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -67.2316658572122 59 | 20 60 | 137.794074793589 61 | 30 62 | 0.0 63 | 11 64 | -42.0660514813016 65 | 21 66 | 137.794074793589 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -42.0660514813016 75 | 20 76 | 137.794074793589 77 | 30 78 | 0.0 79 | 11 80 | 0.616804273919382 81 | 21 82 | 28.1262748907236 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | 0.616804273919382 91 | 20 92 | 28.1262748907236 93 | 30 94 | 0.0 95 | 11 96 | 42.9295774647887 97 | 21 98 | 137.794074793589 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | 42.9295774647887 107 | 20 108 | 137.794074793589 109 | 30 110 | 0.0 111 | 11 112 | 67.2316658572122 113 | 21 114 | 137.794074793589 115 | 31 116 | 0.0 117 | 0 118 | ENDSEC 119 | 0 120 | EOF 121 | -------------------------------------------------------------------------------- /data/dxf/wm.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 92.7673627974745 11 | 20 12 | 137.794074793589 13 | 30 14 | 0.0 15 | 11 16 | 56.8693540553667 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 56.8693540553667 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | 35.4045653229723 33 | 21 34 | 0.0 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | 35.4045653229723 43 | 20 44 | 0.0 45 | 30 46 | 0.0 47 | 11 48 | 0.0 49 | 21 50 | 106.213695968917 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 0.0 59 | 20 60 | 106.213695968917 61 | 30 62 | 0.0 63 | 11 64 | -35.1578436134046 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -35.1578436134046 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -56.4992714910151 81 | 21 82 | 0.0 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -56.4992714910151 91 | 20 92 | 0.0 93 | 30 94 | 0.0 95 | 11 96 | -92.7673627974745 97 | 21 98 | 137.794074793589 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -92.7673627974745 107 | 20 108 | 137.794074793589 109 | 30 110 | 0.0 111 | 11 112 | -68.5886352598349 113 | 21 114 | 137.794074793589 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -68.5886352598349 123 | 20 124 | 137.794074793589 125 | 30 126 | 0.0 127 | 11 128 | -43.2996600291404 129 | 21 130 | 31.0869354055367 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -43.2996600291404 139 | 20 140 | 31.0869354055367 141 | 30 142 | 0.0 143 | 11 144 | -8.88198154443904 145 | 21 146 | 137.794074793589 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | -8.88198154443904 155 | 20 156 | 137.794074793589 157 | 30 158 | 0.0 159 | 11 160 | 10.2389509470617 161 | 21 162 | 137.794074793589 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 10.2389509470617 171 | 20 172 | 137.794074793589 173 | 30 174 | 0.0 175 | 11 176 | 45.5201554152501 177 | 21 178 | 31.0869354055367 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 45.5201554152501 187 | 20 188 | 31.0869354055367 189 | 30 190 | 0.0 191 | 11 192 | 69.452161243322 193 | 21 194 | 137.794074793589 195 | 31 196 | 0.0 197 | 0 198 | LINE 199 | 8 200 | COMPONENT0 201 | 10 202 | 69.452161243322 203 | 20 204 | 137.794074793589 205 | 30 206 | 0.0 207 | 11 208 | 92.7673627974745 209 | 21 210 | 137.794074793589 211 | 31 212 | 0.0 213 | 0 214 | ENDSEC 215 | 0 216 | EOF 217 | -------------------------------------------------------------------------------- /data/dxf/xm.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 67.3550267119961 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | 38.1185041282176 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | 38.1185041282176 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -0.986886838271006 33 | 21 34 | 52.9218067022827 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -0.986886838271006 43 | 20 44 | 52.9218067022827 45 | 30 46 | 0.0 47 | 11 48 | -40.3389995143273 49 | 21 50 | 0.0 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -40.3389995143273 59 | 20 60 | 0.0 61 | 30 62 | 0.0 63 | 11 64 | -67.3550267119961 65 | 21 66 | 0.0 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -67.3550267119961 75 | 20 76 | 0.0 77 | 30 78 | 0.0 79 | 11 80 | -13.5696940262263 81 | 21 82 | 68.7119961146187 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -13.5696940262263 91 | 20 92 | 68.7119961146187 93 | 30 94 | 0.0 95 | 11 96 | -66.8615832928606 97 | 21 98 | 137.794074793589 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | -66.8615832928606 107 | 20 108 | 137.794074793589 109 | 30 110 | 0.0 111 | 11 112 | -37.6250607090821 113 | 21 114 | 137.794074793589 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | -37.6250607090821 123 | 20 124 | 137.794074793589 125 | 30 126 | 0.0 127 | 11 128 | 1.23360854783875 129 | 21 130 | 85.7357940747936 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | 1.23360854783875 139 | 20 140 | 85.7357940747936 141 | 30 142 | 0.0 143 | 11 144 | 40.2156386595435 145 | 21 146 | 137.794074793589 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 40.2156386595435 155 | 20 156 | 137.794074793589 157 | 30 158 | 0.0 159 | 11 160 | 67.3550267119961 161 | 21 162 | 137.794074793589 163 | 31 164 | 0.0 165 | 0 166 | LINE 167 | 8 168 | COMPONENT0 169 | 10 170 | 67.3550267119961 171 | 20 172 | 137.794074793589 173 | 30 174 | 0.0 175 | 11 176 | 13.1996114618747 177 | 21 178 | 69.9456046624575 179 | 31 180 | 0.0 181 | 0 182 | LINE 183 | 8 184 | COMPONENT0 185 | 10 186 | 13.1996114618747 187 | 20 188 | 69.9456046624575 189 | 30 190 | 0.0 191 | 11 192 | 67.3550267119961 193 | 21 194 | 0.0 195 | 31 196 | 0.0 197 | 0 198 | ENDSEC 199 | 0 200 | EOF 201 | -------------------------------------------------------------------------------- /data/dxf/ym.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 67.2316658572122 11 | 20 12 | 131.734467691243 13 | 30 14 | 0.0 15 | 11 16 | -13.1996114618747 17 | 21 18 | -56.8842792733033 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -13.1996114618747 27 | 20 28 | -56.8842792733033 29 | 30 30 | 0.0 31 | 11 32 | -37.9951432734337 33 | 21 34 | -56.8842792733033 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -37.9951432734337 43 | 20 44 | -56.8842792733033 45 | 30 46 | 0.0 47 | 11 48 | -12.3360854783876 49 | 21 50 | 0.601879055982794 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | -12.3360854783876 59 | 20 60 | 0.601879055982794 61 | 30 62 | 0.0 63 | 11 64 | -67.2316658572122 65 | 21 66 | 131.734467691243 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -67.2316658572122 75 | 20 76 | 131.734467691243 77 | 30 78 | 0.0 79 | 11 80 | -42.0660514813016 81 | 21 82 | 131.734467691243 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -42.0660514813016 91 | 20 92 | 131.734467691243 93 | 30 94 | 0.0 95 | 11 96 | 0.246721709567746 97 | 21 98 | 29.5916799301936 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | 0.246721709567746 107 | 20 108 | 29.5916799301936 109 | 30 110 | 0.0 111 | 11 112 | 42.9295774647887 113 | 21 114 | 131.734467691243 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 42.9295774647887 123 | 20 124 | 131.734467691243 125 | 30 126 | 0.0 127 | 11 128 | 67.2316658572122 129 | 21 130 | 131.734467691243 131 | 31 132 | 0.0 133 | 0 134 | ENDSEC 135 | 0 136 | EOF 137 | -------------------------------------------------------------------------------- /data/dxf/zm.dxf: -------------------------------------------------------------------------------- 1 | 0 2 | SECTION 3 | 2 4 | ENTITIES 5 | 0 6 | LINE 7 | 8 8 | COMPONENT0 9 | 10 10 | 55.6357455075279 11 | 20 12 | 0.0 13 | 30 14 | 0.0 15 | 11 16 | -55.6357455075279 17 | 21 18 | 0.0 19 | 31 20 | 0.0 21 | 0 22 | LINE 23 | 8 24 | COMPONENT0 25 | 10 26 | -55.6357455075279 27 | 20 28 | 0.0 29 | 30 30 | 0.0 31 | 11 32 | -55.6357455075279 33 | 21 34 | 17.1471588149587 35 | 31 36 | 0.0 37 | 0 38 | LINE 39 | 8 40 | COMPONENT0 41 | 10 42 | -55.6357455075279 43 | 20 44 | 17.1471588149587 45 | 30 46 | 0.0 47 | 11 48 | 24.6721709567751 49 | 21 50 | 118.426420592521 51 | 31 52 | 0.0 53 | 0 54 | LINE 55 | 8 56 | COMPONENT0 57 | 10 58 | 24.6721709567751 59 | 20 60 | 118.426420592521 61 | 30 62 | 0.0 63 | 11 64 | -53.9086935405537 65 | 21 66 | 118.426420592521 67 | 31 68 | 0.0 69 | 0 70 | LINE 71 | 8 72 | COMPONENT0 73 | 10 74 | -53.9086935405537 75 | 20 76 | 118.426420592521 77 | 30 78 | 0.0 79 | 11 80 | -53.9086935405537 81 | 21 82 | 137.794074793589 83 | 31 84 | 0.0 85 | 0 86 | LINE 87 | 8 88 | COMPONENT0 89 | 10 90 | -53.9086935405537 91 | 20 92 | 137.794074793589 93 | 30 94 | 0.0 95 | 11 96 | 53.538610976202 97 | 21 98 | 137.794074793589 99 | 31 100 | 0.0 101 | 0 102 | LINE 103 | 8 104 | COMPONENT0 105 | 10 106 | 53.538610976202 107 | 20 108 | 137.794074793589 109 | 30 110 | 0.0 111 | 11 112 | 53.538610976202 113 | 21 114 | 121.26372025255 115 | 31 116 | 0.0 117 | 0 118 | LINE 119 | 8 120 | COMPONENT0 121 | 10 122 | 53.538610976202 123 | 20 124 | 121.26372025255 125 | 30 126 | 0.0 127 | 11 128 | -27.1393880524526 129 | 21 130 | 19.6143759106362 131 | 31 132 | 0.0 133 | 0 134 | LINE 135 | 8 136 | COMPONENT0 137 | 10 138 | -27.1393880524526 139 | 20 140 | 19.6143759106362 141 | 30 142 | 0.0 143 | 11 144 | 55.6357455075279 145 | 21 146 | 19.6143759106362 147 | 31 148 | 0.0 149 | 0 150 | LINE 151 | 8 152 | COMPONENT0 153 | 10 154 | 55.6357455075279 155 | 20 156 | 19.6143759106362 157 | 30 158 | 0.0 159 | 11 160 | 55.6357455075279 161 | 21 162 | 0.0 163 | 31 164 | 0.0 165 | 0 166 | ENDSEC 167 | 0 168 | EOF 169 | -------------------------------------------------------------------------------- /images/string.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avalero/OOML/8e333a35f23126a9b9e953b23b2faa57a9288bca/images/string.png -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | # List of all project modules. 5 | add_subdirectory("core") 6 | add_subdirectory("components") 7 | add_subdirectory("parts") 8 | 9 | file(GLOB BASE_HEADERS "*.h") 10 | install(FILES ${BASE_HEADERS} DESTINATION include/ooml) 11 | -------------------------------------------------------------------------------- /src/components.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPONENTS_H 2 | #define COMPONENTS_H 3 | 4 | #include "components/Char.h" 5 | #include "components/Circle.h" 6 | #include "components/Cube.h" 7 | #include "components/Cylinder.h" 8 | #include "components/PolygonalPiramid.h" 9 | #include "components/PolygonalPrism.h" 10 | #include "components/RegularPiramid.h" 11 | #include "components/RegularPrism.h" 12 | #include "components/RoundedCube.h" 13 | #include "components/RoundedCylinder.h" 14 | #include "components/RoundedTablet.h" 15 | #include "components/Sphere.h" 16 | #include "components/Square.h" 17 | #include "components/Toroid.h" 18 | #include "components/RefSysView.h" 19 | #include "components/LinksView.h" 20 | #include "components/String.h" 21 | #endif // COMPONENTS_H 22 | -------------------------------------------------------------------------------- /src/components/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | # Create components library 5 | file(GLOB COMPONENTS_SOURCES "*.h" "*.cpp") 6 | add_library(OOMLComponents SHARED ${COMPONENTS_SOURCES}) 7 | target_link_libraries(OOMLComponents OOMLCore) 8 | 9 | # Install components library 10 | install(TARGETS OOMLComponents DESTINATION lib) 11 | file(GLOB COMPONENTS_HEADERS "*.h") 12 | install(FILES ${COMPONENTS_HEADERS} DESTINATION include/ooml/components) 13 | -------------------------------------------------------------------------------- /src/components/Char.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OOML_CHAR_H 21 | #define OOML_CHAR_H 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | #include "../core/DXFLinearExtrude.h" 39 | #include "../core/AbstractPart.h" 40 | 41 | /** 42 | * \brief Extruded Char primitive object 43 | * 44 | * This class provides an 3D Char. 45 | */ 46 | 47 | 48 | class OOMLComponents_EXP_DEC Char : public Component 49 | { 50 | struct Data{ 51 | char _character; 52 | double _height; 53 | bool _created; 54 | bool _capitalized; 55 | double _font_size; 56 | }; 57 | 58 | public: 59 | Char(char character, double font_size, double height); 60 | Data getData(){ 61 | return data; 62 | } 63 | bool exists(){ 64 | return data._created; 65 | } 66 | 67 | private: 68 | Data data; 69 | }; 70 | 71 | #endif // CHAR_H 72 | -------------------------------------------------------------------------------- /src/components/Circle.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Circle::genScad(IndentWriter& writer) const 26 | { 27 | writer << "circle(r=" << _radius << ", $fn=" << _faces << ");" << std::endl; 28 | } 29 | 30 | void Circle::printAst(IndentWriter& writer) const 31 | { 32 | writer << "// CIRCLE(" << _radius << ", " << _faces << ")" << std::endl; 33 | } 34 | -------------------------------------------------------------------------------- /src/components/Cube.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | -------------------------------------------------------------------------------- /src/components/Cylinder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | -------------------------------------------------------------------------------- /src/components/CylindricalSection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/components/LinksView.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "LinksView.h" 21 | #include "RefSysView.h" 22 | #include "Cylinder.h" 23 | #include "../core/Union.h" 24 | #include "../core/IndentWriter.h" 25 | 26 | 27 | #include 28 | 29 | Component LinksView::genComponent() 30 | { 31 | CompositeComponent linksview = Union::create(); 32 | 33 | for (int i=0; i<_links.size();i++){ 34 | linksview << RefSysView(_links[i]); 35 | } 36 | 37 | return linksview; 38 | } 39 | -------------------------------------------------------------------------------- /src/components/LinksView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OOML_LINKSWIEW_H_INCLUDED 21 | #define OOML_LINKSWIEW_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | 34 | #include "../core/IndentWriter.h" 35 | #include "../core/RefSys.h" 36 | #include "../core/Component.h" 37 | #include 38 | 39 | #include 40 | 41 | /** 42 | * \brief 3D point primitive object 43 | * 44 | * This class provides a 3D point. 45 | */ 46 | class OOMLComponents_EXP_DEC LinksView : public Component 47 | { 48 | public: 49 | /** 50 | * \brief Default constructor. 51 | */ 52 | LinksView() 53 | { 54 | _links.clear(); 55 | _links.resize(0); 56 | set(genComponent().get()); 57 | } 58 | /** 59 | * \brief constructor. 60 | * 61 | * \param other Build from a RefSys. 62 | */ 63 | 64 | LinksView(Links const & links) : 65 | _links(links) 66 | { 67 | set(genComponent().get()); 68 | } 69 | 70 | LinksView(LinksView const & other): 71 | _links(other._links) 72 | { 73 | set(genComponent().get()); 74 | } 75 | 76 | LinksView(Component const & comp) 77 | { 78 | _links=comp.getLinks(); 79 | set(genComponent().get()); 80 | } 81 | 82 | 83 | /** 84 | * \brief Default destructor. 85 | */ 86 | virtual ~LinksView() {} 87 | 88 | private: 89 | Links _links; 90 | Component genComponent(); 91 | }; 92 | 93 | #endif // OOML_LINKSWIEW_H_INCLUDED 94 | -------------------------------------------------------------------------------- /src/components/PolygonalPiramid.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | Component PolygonalPiramid::build() 26 | { 27 | Component component(Polyhedron::create()); 28 | Polyhedron & polyhedron = dynamic_cast(*component.get().get()); 29 | 30 | // Add all the points 31 | polyhedron << _apex; 32 | for (Polygon::PointVector::const_iterator it = _base.getPoints().begin(); 33 | it != _base.getPoints().end(); ++it) 34 | polyhedron << Point3D(it->getX(), it->getY(), 0.0); 35 | 36 | unsigned int baseLength = _base.getPoints().size(); 37 | 38 | // Bottom face 39 | for (unsigned int i = 0; i < baseLength - 2; ++i) 40 | { 41 | unsigned int base = baseLength - i; 42 | polyhedron.addTriangle(base, base - 1, 1); 43 | } 44 | 45 | // Lateral faces 46 | for (unsigned int i = 1; i < baseLength + 1; ++i) 47 | polyhedron.addTriangle(0, i, i % baseLength + 1); 48 | 49 | return component; 50 | } 51 | -------------------------------------------------------------------------------- /src/components/PolygonalPiramid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef POLYGONALPIRAMID_H_INCLUDED 21 | #define POLYGONALPIRAMID_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | /** 39 | * \brief Polygonal base piramid primitive object 40 | * 41 | * This class provides a piramid with a polygonal base. 42 | */ 43 | class OOMLComponents_EXP_DEC PolygonalPiramid : public AbstractPart 44 | { 45 | public: 46 | /** 47 | * \brief Default constructor. 48 | */ 49 | PolygonalPiramid() : 50 | AbstractPart(), 51 | _base(), 52 | _apex() 53 | { 54 | rebuild(); 55 | } 56 | /** 57 | * \brief Create parametrized Polygonal 58 | * 59 | * The base must be convex and counter-clockwise ordered viewed from top. 60 | * 61 | * \param base Polygon used as base of the piramid. 62 | * \param apex Apex point of the piramid. 63 | * \return PolygonalPiramid Component 64 | */ 65 | PolygonalPiramid(Polygon const& base, Point3D const& apex) : 66 | AbstractPart(), 67 | _base(base), 68 | _apex(apex) 69 | { 70 | rebuild(); 71 | } 72 | /** 73 | * \brief Default destructor. 74 | */ 75 | virtual ~PolygonalPiramid() {} 76 | 77 | protected: 78 | /** 79 | * \brief Build the piece. 80 | * 81 | * This method build the piece from simpler objects. 82 | * 83 | * \return The piece built. 84 | */ 85 | virtual Component build(); 86 | 87 | private: 88 | Polygon _base; /** Polygonal base of the piramid */ 89 | Point3D _apex; /** Apex point of the piramid */ 90 | }; 91 | 92 | #endif // POLYGONALPIRAMID_H_INCLUDED 93 | -------------------------------------------------------------------------------- /src/components/RefSysView.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "RefSysView.h" 21 | #include "Cylinder.h" 22 | #include "../core/Union.h" 23 | #include "../core/IndentWriter.h" 24 | 25 | #include 26 | 27 | Component RefSysView::genComponent() 28 | { 29 | Component x_axis = Cylinder(0.5,7,10,false) 30 | + Cylinder(1,0,3,10,false).translate(0,0,7); 31 | x_axis.rotate(0,90,0); 32 | 33 | Component y_axis = Cylinder(0.5,7,10,false) 34 | + Cylinder(1,0,3,10,false).translate(0,0,7);; 35 | y_axis.rotate(-90,0,0); 36 | 37 | Component z_axis = Cylinder(0.5,7,10,false) 38 | + Cylinder(1,0,3,10,false).translate(0,0,7); 39 | 40 | Component refsysview = x_axis.color(1,0,0) 41 | + y_axis.color(0,1,0) 42 | + z_axis.color(0,0,1) 43 | ; 44 | TransformMatrix trans = _refSys.getTransformMatrix(); 45 | double ax,ay,az; trans.getGlobalXYZAngles(ax,ay,az); 46 | double x,y,z; trans.getGlobalTranslation(x,y,z); 47 | 48 | 49 | 50 | refsysview.rotate(ax,ay,az).translate(x,y,z); 51 | 52 | return refsysview; 53 | } 54 | -------------------------------------------------------------------------------- /src/components/RefSysView.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OOML_REFSYSIEW_H_INCLUDED 21 | #define OOML_REFSYSIEW_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | 34 | #include "../core/IndentWriter.h" 35 | #include "../core/RefSys.h" 36 | #include "../core/Component.h" 37 | #include 38 | 39 | #include 40 | 41 | /** 42 | * \brief 3D point primitive object 43 | * 44 | * This class provides a 3D point. 45 | */ 46 | class OOMLComponents_EXP_DEC RefSysView : public Component 47 | { 48 | public: 49 | /** 50 | * \brief Default constructor. 51 | */ 52 | RefSysView() : _refSys() 53 | { 54 | set(genComponent().get()); 55 | } 56 | /** 57 | * \brief constructor. 58 | * 59 | * \param other Build from a RefSys. 60 | */ 61 | 62 | RefSysView(RefSys const & ref) : 63 | _refSys(ref) 64 | { 65 | set(genComponent().get()); 66 | } 67 | 68 | RefSysView(RefSysView const & other): 69 | _refSys(other._refSys) 70 | { 71 | set(genComponent().get()); 72 | } 73 | 74 | RefSysView(Component const & comp) 75 | { 76 | _refSys = comp.getRefSys(); 77 | 78 | set(genComponent().get()); 79 | } 80 | 81 | 82 | /** 83 | * \brief Default destructor. 84 | */ 85 | virtual ~RefSysView() {} 86 | 87 | private: 88 | RefSys _refSys; 89 | Component genComponent(); 90 | }; 91 | 92 | #endif // OOML_REFSYSIEW_H_INCLUDED 93 | -------------------------------------------------------------------------------- /src/components/RegularPiramid.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/components/RegularPiramid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef REGULARPIRAMID_H_INCLUDED 21 | #define REGULARPIRAMID_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | /** 41 | * \brief Regular base piramid primitive object 42 | * 43 | * This class provides a piramid with a regular base. 44 | */ 45 | class OOMLComponents_EXP_DEC RegularPiramid: public Component 46 | { 47 | public: 48 | /** 49 | * \brief Constructor 50 | * 51 | * Creates a regular piramid with the given regular n-side polygon. 52 | * 53 | * \param n Number of sides of the base regular polygon. 54 | * \param s Length of every side of the base regular polygon. 55 | * \param height Height over the z=0 plane of the apex. 56 | * 57 | * 58 | */ 59 | RegularPiramid(unsigned int n, double s, double height) : 60 | Component() 61 | { 62 | if (n < 3) 63 | n = 3; 64 | 65 | double angle = 2 * M_PI / n; 66 | double radius = s / 2 / sin(M_PI / 4); 67 | 68 | Polygon base; 69 | for (unsigned int i = 0; i < n; ++i) 70 | { 71 | double a = angle * i; 72 | base.addPoint(Point2D(radius * cos(a), radius * sin(a))); 73 | } 74 | 75 | set(PolygonalPrism(base, height).get()); 76 | } 77 | }; 78 | 79 | #endif // REGULARPIRAMID_H_INCLUDED 80 | -------------------------------------------------------------------------------- /src/components/RegularPrism.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/components/RegularPrism.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef REGULARPRISM_H_INCLUDED 21 | #define REGULARPRISM_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | /** 41 | * \brief Regular base prism primitive object 42 | * 43 | * This class provides a prism with a regular base. 44 | */ 45 | class OOMLComponents_EXP_DEC RegularPrism: public Component 46 | { 47 | public: 48 | /** 49 | * \brief Constructor 50 | * 51 | * Creates a regular prism with the given regular n-side polygon. 52 | * 53 | * \param n Number of sides of the base regular polygon. 54 | * \param s Length of every side of the base regular polygon. 55 | * \param height Height over the z=0 plane of the apex. 56 | * 57 | */ 58 | RegularPrism(unsigned int n, double s, double height) : 59 | Component() 60 | { 61 | if (n < 3) 62 | n = 3; 63 | 64 | double angle = 2.0 * M_PI / n; 65 | double radius = s / 2 / sin(M_PI / 4); 66 | 67 | Polygon base; 68 | for (unsigned int i = 0; i < n; i++) 69 | { 70 | double a = angle * i; 71 | base.addPoint(Point2D(radius * cos(a), radius * sin(a))); 72 | } 73 | 74 | //std::cout << base.getPoints().size() << std::endl; 75 | 76 | set((PolygonalPrism(base, height)).get()); 77 | } 78 | }; 79 | 80 | 81 | #endif // REGULARPRISM_H_INCLUDED 82 | -------------------------------------------------------------------------------- /src/components/RoundedCube.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/components/RoundedCylinder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/components/RoundedTablet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/components/Sphere.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "Sphere.h" 21 | -------------------------------------------------------------------------------- /src/components/Square.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Square::genScad(IndentWriter& writer) const 26 | { 27 | writer << "square(size=[" << _sx << ", " << _sy << "], center=" << _center << ");" << std::endl; 28 | } 29 | 30 | void Square::printAst(IndentWriter& writer) const 31 | { 32 | writer << "// SQUARE(" << _sx << ", " << _sy << ", " << _center << ")" << std::endl; 33 | } 34 | -------------------------------------------------------------------------------- /src/components/String.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "String.h" 21 | #include "config.h" 22 | #include 23 | #include "../core/CompositeComponent.h" 24 | #include "../core/Union.h" 25 | 26 | 27 | String::String(string cad, double font_size, double spacing, double height) : 28 | Component() 29 | { 30 | 31 | data._string=cad; 32 | data._height=height; 33 | data._spacing = spacing; 34 | data._font_size=font_size; 35 | 36 | CompositeComponent comp = Union::create(); 37 | 38 | for (int i=0; i. 17 | * 18 | */ 19 | 20 | #ifndef OOML_STRING_H 21 | #define OOML_STRING_H 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLComponents_EXPORTS 25 | #define OOMLComponents_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLComponents_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLComponents_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | using namespace std; 37 | 38 | #include "../core/DXFLinearExtrude.h" 39 | #include "../core/AbstractPart.h" 40 | #include "Char.h" 41 | 42 | /** 43 | * \brief Extruded Char primitive object 44 | * 45 | * This class provides an 3D Char. 46 | */ 47 | 48 | 49 | class OOMLComponents_EXP_DEC String : public Component 50 | { 51 | struct Data{ 52 | string _string; 53 | double _height; 54 | bool _created; 55 | double _font_size; 56 | double _spacing; 57 | }; 58 | 59 | 60 | public: 61 | String(string cad, double font_size, double spacing, double height); 62 | Data getData(){ 63 | return data; 64 | } 65 | bool exists(){ 66 | return data._created; 67 | } 68 | 69 | private: 70 | Data data; 71 | }; 72 | 73 | #endif // CHAR_H 74 | -------------------------------------------------------------------------------- /src/components/Toroid.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | Component Toroid::build() 25 | { 26 | Component2D circle(Circle::create(_sectionRadius, _faces) 27 | .translate(_toroidRadius, 0.0, 0.0)); 28 | return circle.rotateExtrudedCopy(10, _faces); 29 | } 30 | -------------------------------------------------------------------------------- /src/config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OOML_CONFIG_H 21 | #define OOML_CONFIG_H 22 | 23 | // define dxf path 24 | #define DXF_PATH "@OOML_DATA_DIR@/dxf" 25 | #define DXF_INSTALLED_PATH "@CMAKE_INSTALL_PREFIX@include/ooml/data/dxf" 26 | 27 | 28 | 29 | #endif // OOML_CONFIG_H 30 | -------------------------------------------------------------------------------- /src/core/AbstractObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | bool AbstractObject::_debugFlag = false; 23 | 24 | 25 | IndentWriter& operator<<(IndentWriter & writer, AbstractObject const& object) 26 | { 27 | object.genScad(writer); 28 | return writer; 29 | } 30 | -------------------------------------------------------------------------------- /src/core/AbstractPackage.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | void AbstractPackage::genScadFiles() const 27 | { 28 | for (Map::const_iterator it = _children.begin(); it != _children.end(); 29 | ++it) 30 | { 31 | std::ofstream fd(std::string(it->first + ".scad").c_str()); 32 | if (fd) 33 | { 34 | IndentWriter writer; 35 | writer << it->second; 36 | fd << writer; 37 | fd.close(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/core/AbstractPart.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void AbstractPart::genScad(IndentWriter& writer) const 24 | { 25 | Component::genScad(writer); 26 | } 27 | 28 | void AbstractPart::printAst(IndentWriter& writer) const 29 | { 30 | Component::printAst(writer); 31 | } 32 | -------------------------------------------------------------------------------- /src/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | # Create core library 5 | file(GLOB CORE_SOURCES "*.h" "*.cpp") 6 | add_library(OOMLCore SHARED ${CORE_SOURCES}) 7 | 8 | # Install core library 9 | install(TARGETS OOMLCore DESTINATION lib) 10 | file(GLOB CORE_HEADERS "*.h") 11 | install(FILES ${CORE_HEADERS} DESTINATION include/ooml/core) 12 | -------------------------------------------------------------------------------- /src/core/ColorDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void ColorDecorator::genScad(IndentWriter& writer) const 24 | { 25 | writer << "color([" << _r << ", " << _g << ", " << _b << ", " << _a << "]) {" << std::endl; 26 | { 27 | IndentBlock block(writer); 28 | ObjectDecorator::genScad(writer); 29 | } 30 | writer << "} // End color" << std::endl; 31 | } 32 | 33 | void ColorDecorator::printAst(IndentWriter& writer) const 34 | { 35 | writer << "Color(" << _r << ", " << _g << ", " << _b << ", " << _a << ")" << std::endl; 36 | ObjectDecorator::printAst(writer); 37 | } 38 | -------------------------------------------------------------------------------- /src/core/CompositeObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void CompositeObject::genScad(IndentWriter& writer) const 24 | { 25 | for (Vector::const_iterator it = _children.begin(); it != _children.end(); ++it) 26 | (*it)->genScad(writer); 27 | } 28 | 29 | void CompositeObject::printAst(IndentWriter& writer) const 30 | { 31 | for (Vector::const_iterator it = _children.begin(); it != _children.end(); ++it) 32 | (*it)->printAst(writer); 33 | } 34 | 35 | RefSys CompositeObject::getRefSys() const { 36 | if (hasRefSys()){ 37 | return AbstractObject::getRefSys(); 38 | }else{ 39 | return _children[0]->getRefSys(); 40 | } 41 | } 42 | 43 | Links CompositeObject::getLinks() const { 44 | if (hasLinks()){ 45 | Links lks1 = AbstractObject::getLinks(); 46 | Links lks2 = _children[0]->getLinks(); 47 | lks1.insert( lks1.end(), lks2.begin(), lks2.end() ); 48 | return lks1; 49 | //return AbstractObject::getLinks(); 50 | }else{ 51 | return _children[0]->getLinks(); 52 | } 53 | } 54 | 55 | RefSys CompositeObject::getLink(int i) const { 56 | if (hasLinks()){ 57 | Links lks1 = AbstractObject::getLinks(); 58 | Links lks2 = _children[0]->getLinks(); 59 | lks1.insert( lks1.end(), lks2.begin(), lks2.end() ); 60 | return lks1[i]; 61 | //return AbstractObject::getLink(i); 62 | }else{ 63 | return _children[0]->getLink(i); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/core/CubeObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "CubeObject.h" 21 | #include "IndentWriter.h" 22 | 23 | #include 24 | 25 | void CubeObject::genScad(IndentWriter& writer) const 26 | { 27 | writer << "cube(size=[" << _sx << ", " << _sy << ", " << _sz << "], center=" << _center << ");" << std::endl; 28 | } 29 | 30 | void CubeObject::printAst(IndentWriter& writer) const 31 | { 32 | writer << "// CUBE(" << _sx << ", " << _sy << ", " << _sz << ", " << _center << ")" << std::endl; 33 | } 34 | -------------------------------------------------------------------------------- /src/core/CylinderObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "CylinderObject.h" 21 | #include "IndentWriter.h" 22 | 23 | #include 24 | 25 | void CylinderObject::genScad(IndentWriter& writer) const 26 | { 27 | writer << "cylinder(h=" << _height <<", r1=" << _radius1 <<", r2=" << _radius2 << ", $fn=" << _faces 28 | << ", center=" << _center << ");" << std::endl; 29 | } 30 | 31 | void CylinderObject::printAst(IndentWriter& writer) const 32 | { 33 | writer << "// CYLINDER(" << _height << ", " << _radius1 << ", " << _radius2 << ", " << _faces << ", " << _center << ")" << std::endl; 34 | } 35 | -------------------------------------------------------------------------------- /src/core/DXFLinearExtrude.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void DXFLinearExtrude::genScad(IndentWriter& writer) const 24 | { 25 | writer << "linear_extrude(height=" << _height << ", twist=" << _twist << ", $fn=" << _faces << ", convexity=" << _convexity << ", center=" << _center << "){import (\""<< _DXFFilename <<"\");}" << std::endl; 26 | } 27 | 28 | void DXFLinearExtrude::printAst(IndentWriter& writer) const 29 | { 30 | writer << "// LINEAR_EXTRUDE("<< _height << ", " << _twist << ", " << _faces << ", " << _convexity << ", " << _center << "){" << _DXFFilename << "};" << std::endl; 31 | } 32 | -------------------------------------------------------------------------------- /src/core/DXFRotateExtrude.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void DXFRotateExtrude::genScad(IndentWriter& writer) const 24 | { 25 | writer << "rotate_extrude(file=\"" << _DXFFilename << "\", convexity=" << _convexity << ", $fn=" << _faces << ");" << std::endl; 26 | } 27 | 28 | void DXFRotateExtrude::printAst(IndentWriter& writer) const 29 | { 30 | writer << "// ROTATE_EXTRUDE(" << _DXFFilename << ", " << _convexity << ", " << _faces << ")" << std::endl; 31 | } 32 | -------------------------------------------------------------------------------- /src/core/Difference.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Difference::genScad(IndentWriter& writer) const 26 | { 27 | writer << "difference() {" << std::endl; 28 | { 29 | IndentBlock block(writer); 30 | CompositeObject::genScad(writer); 31 | } 32 | writer << "} // End difference" << std::endl; 33 | } 34 | 35 | void Difference::printAst(IndentWriter& writer) const 36 | { 37 | writer << "// DIFFERENCE()" << std::endl; 38 | { 39 | IndentBlock block(writer); 40 | CompositeObject::printAst(writer); 41 | } 42 | } 43 | 44 | Component operator-(Component const& lhs, Component const& rhs) 45 | { 46 | CompositeComponent result(Difference::create()); 47 | result << lhs.get() << rhs.get(); 48 | return result; 49 | } 50 | -------------------------------------------------------------------------------- /src/core/Hull.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Hull::genScad(IndentWriter& writer) const 26 | { 27 | writer << "hull() {" << std::endl; 28 | { 29 | IndentBlock block(writer); 30 | CompositeObject::genScad(writer); 31 | } 32 | writer << "} // End hull" << std::endl; 33 | } 34 | 35 | void Hull::printAst(IndentWriter& writer) const 36 | { 37 | writer << "// HULL()" << std::endl; 38 | { 39 | IndentBlock block(writer); 40 | CompositeObject::printAst(writer); 41 | } 42 | } 43 | 44 | Component operator&(Component const& lhs, Component const& rhs) 45 | { 46 | CompositeComponent result(Hull::create()); 47 | result << lhs.get() << rhs.get(); 48 | return result; 49 | } 50 | -------------------------------------------------------------------------------- /src/core/Imported.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | SharedPtr Imported::create(std::string const& filename) 28 | { 29 | std::ifstream scadFile; 30 | scadFile.open(filename.c_str()); 31 | 32 | std::string scadCode; 33 | if (scadFile.is_open()) 34 | { 35 | while(!scadFile.eof()) 36 | scadCode += scadFile.get(); 37 | scadFile.close(); 38 | scadCode.erase(scadCode.end() - 1); // Avoid EOF character 39 | } 40 | else 41 | { 42 | throw ImportError(); 43 | } 44 | 45 | return SharedPtr(new Imported(filename, scadCode)); 46 | } 47 | 48 | void Imported::genScad(IndentWriter& writer) const 49 | { 50 | writer << "// Imported file '" << _filename << "'" << std::endl; 51 | for (std::string::const_iterator it = _scadCode.begin() 52 | ; it != _scadCode.end(); ++it) 53 | { 54 | switch(*it) 55 | { 56 | case '\n': 57 | writer << std::endl; 58 | break; 59 | default: 60 | writer << *it; 61 | break; 62 | } 63 | } 64 | writer << "// End imported file '" << _filename << "'" << std::endl; 65 | } 66 | 67 | void Imported::printAst(IndentWriter& writer) const 68 | { 69 | writer << "IMPORTED()" << std::endl; 70 | } 71 | -------------------------------------------------------------------------------- /src/core/IndentWriter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | 22 | #include 23 | 24 | std::ostream& operator<<(std::ostream& os, IndentWriter const& writer) 25 | { 26 | writer.dump(os); 27 | return os; 28 | } 29 | -------------------------------------------------------------------------------- /src/core/Intersection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Intersection::genScad(IndentWriter& writer) const 26 | { 27 | writer << "intersection() {" << std::endl; 28 | { 29 | IndentBlock block(writer); 30 | CompositeObject::genScad(writer); 31 | } 32 | writer << "} // End intersection" << std::endl; 33 | } 34 | 35 | void Intersection::printAst(IndentWriter& writer) const 36 | { 37 | writer << "// INTERSECTION()" << std::endl; 38 | { 39 | IndentBlock block(writer); 40 | CompositeObject::printAst(writer); 41 | } 42 | } 43 | 44 | Component operator*(Component const& lhs, Component const& rhs) 45 | { 46 | CompositeComponent result(Intersection::create()); 47 | result << lhs.get() << rhs.get(); 48 | return result; 49 | } 50 | -------------------------------------------------------------------------------- /src/core/LinearExtrudeDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void LinearExtrudeDecorator::genScad(IndentWriter& writer) const 24 | { 25 | writer << "linear_extrude(height=" << _height << ", twist=" << _twist << ", $fn=" << _faces << ", convexity=" << _convexity << ", center=" << _center << ") {" << std::endl; 26 | { 27 | IndentBlock block(writer); 28 | ObjectDecorator::genScad(writer); 29 | } 30 | writer << "} // End linear_extrude" << std::endl; 31 | } 32 | 33 | void LinearExtrudeDecorator::printAst(IndentWriter& writer) const 34 | { 35 | writer << "// LINEAR_EXTRUDE(" << _height << ", " << _twist << ", " << _faces << ", " << _convexity << ", " << _center << ")" << std::endl; 36 | ObjectDecorator::printAst(writer); 37 | } 38 | -------------------------------------------------------------------------------- /src/core/Math.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef MATH_H_INCLUDED 21 | #define MATH_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLCore_EXPORTS 25 | #define OOMLCore_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLCore_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLCore_EXP_DEC 31 | #endif 32 | 33 | #include 34 | 35 | #ifndef M_PI 36 | #define M_PI 3.14159265358979323846 37 | #endif 38 | 39 | inline double deg2rad(double d){ return M_PI*d/180.0; } 40 | inline double rad2deg(double r){ return 180.0*r/M_PI; } 41 | 42 | #endif // MATH_H_INCLUDED 43 | -------------------------------------------------------------------------------- /src/core/MinkowskiDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void MinkowskiDecorator::genScad(IndentWriter& writer) const 24 | { 25 | writer << "minkowski($fn=" << _faces << ") {" << std::endl; 26 | { 27 | IndentBlock block(writer); 28 | ObjectDecorator::genScad(writer); 29 | _reference.get()->genScad(writer); 30 | } 31 | writer << "} // End minkowski" << std::endl; 32 | } 33 | 34 | void MinkowskiDecorator::printAst(IndentWriter& writer) const 35 | { 36 | writer << "MINKOWSKI("; 37 | _reference.get()->printAst(writer); 38 | writer << ", " << _faces << ")" << std::endl; 39 | ObjectDecorator::printAst(writer); 40 | } 41 | -------------------------------------------------------------------------------- /src/core/MirrorDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void MirrorDecorator::genScad(IndentWriter& writer) const 24 | { 25 | writer << "mirror(v=[" << _vx << ", " << _vy << ", " << _vz << "]) {" << std::endl; 26 | { 27 | IndentBlock block(writer); 28 | ObjectDecorator::genScad(writer); 29 | } 30 | writer << "} // End mirror" << std::endl; 31 | } 32 | 33 | void MirrorDecorator::printAst(IndentWriter& writer) const 34 | { 35 | writer << "MIRROR(" << _vx << ", " << _vy << ", " << _vz << ")" << std::endl; 36 | ObjectDecorator::printAst(writer); 37 | } 38 | -------------------------------------------------------------------------------- /src/core/ObjectDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void ObjectDecorator::genScad(IndentWriter& writer) const 24 | { 25 | if (_decorated.get()) 26 | _decorated->genScad(writer); 27 | } 28 | 29 | 30 | void ObjectDecorator::printAst(IndentWriter& writer) const 31 | { 32 | if (_decorated.get()) 33 | _decorated->printAst(writer); 34 | } 35 | 36 | RefSys ObjectDecorator::getRefSys() const{ 37 | if (_decorated.get()) 38 | return _decorated->getRefSys(); 39 | else return RefSys(0,0,0); 40 | } 41 | 42 | RefSys ObjectDecorator::getLink(int i) const{ 43 | if (_decorated.get()) 44 | return _decorated->getLink(i); 45 | else return RefSys(0,0,0); 46 | } 47 | 48 | Links ObjectDecorator::getLinks() const{ 49 | if (_decorated.get()) 50 | return _decorated->getLinks(); 51 | else 52 | return Links(0); 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/core/Point2D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Point2D::genScad(IndentWriter& writer) const 26 | { 27 | writer << "[" << _x << ", " << _y << "]"; 28 | } 29 | 30 | void Point2D::printAst(IndentWriter& writer) const 31 | { 32 | writer << "(" << _x << ", " << _y << ")"; 33 | } 34 | -------------------------------------------------------------------------------- /src/core/Point3D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | void Point3D::genScad(IndentWriter& writer) const 26 | { 27 | writer << "[" << _x << ", " << _y << ", " << _z << "]"; 28 | } 29 | 30 | void Point3D::printAst(IndentWriter& writer) const 31 | { 32 | writer << "(" << _x << ", " << _y << ", " << _z << ")"; 33 | } 34 | -------------------------------------------------------------------------------- /src/core/Polygon2D.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void Polygon2D::IndexedPath::genScad(IndentWriter& writer) const 24 | { 25 | writer << "["; 26 | for (IndexVector::const_iterator it = _v.begin(); ; ) 27 | { 28 | writer << *it; 29 | if (++it == _v.end()) 30 | break; 31 | writer << ", "; 32 | } 33 | writer << "]"; 34 | } 35 | 36 | void Polygon2D::IndexedPath::printAst(IndentWriter& writer) const 37 | { 38 | writer << "["; 39 | for (IndexVector::const_iterator it = _v.begin(); ; ) 40 | { 41 | writer << *it; 42 | if (++it == _v.end()) 43 | break; 44 | writer << ", "; 45 | } 46 | writer << "]"; 47 | } 48 | 49 | void Polygon2D::genScad(IndentWriter& writer) const 50 | { 51 | writer << "polygon(points="; 52 | _point2DIndexMap.genScad(writer); 53 | writer << ", path="; 54 | _path.genScad(writer); 55 | writer << ");" << std::endl; 56 | } 57 | 58 | void Polygon2D::printAst(IndentWriter& writer) const 59 | { 60 | writer << "POLYGON("; 61 | _point2DIndexMap.printAst(writer); 62 | writer << ", "; 63 | _path.printAst(writer); 64 | writer << ")" << std::endl; 65 | } 66 | -------------------------------------------------------------------------------- /src/core/Polyhedron.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void Polyhedron::IndexedTriangle3D::genScad(IndentWriter& writer) const 24 | { 25 | writer << "[" << _p << ", " << _q << ", " << _r << "]"; 26 | } 27 | 28 | void Polyhedron::IndexedTriangle3D::printAst(IndentWriter& writer) const 29 | { 30 | writer << "[" << _p << ", " << _q << ", " << _r << "]"; 31 | } 32 | 33 | void Polyhedron::genScad(IndentWriter& writer) const 34 | { 35 | const char *comma = ""; 36 | writer << "polyhedron(points="; 37 | _point3DIndexMap.genScad(writer); 38 | writer << ", faces=["; 39 | for (Triangle3DVector::const_iterator it = _triangles.begin(); 40 | it != _triangles.end(); ++it ) 41 | { 42 | writer << comma; 43 | it->genScad(writer); 44 | comma = ", "; 45 | } 46 | writer << "]);" << std::endl; 47 | } 48 | 49 | void Polyhedron::printAst(IndentWriter& writer) const 50 | { 51 | const char *comma = ""; 52 | writer << "POLYHEDRON("; 53 | _point3DIndexMap.printAst(writer); 54 | writer << ", ["; 55 | for (Triangle3DVector::const_iterator it = _triangles.begin(); 56 | it != _triangles.end(); ++it ) 57 | { 58 | writer << comma; 59 | it->printAst(writer); 60 | comma = ", "; 61 | } 62 | writer << "])" << std::endl; 63 | } 64 | -------------------------------------------------------------------------------- /src/core/RefSys.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "RefSys.h" 21 | #include "Union.h" 22 | #include "IndentWriter.h" 23 | 24 | #include 25 | 26 | RefSys RefSys::translate(double x, double y, double z){ 27 | _trans.translate(x,y,z); 28 | return *this; 29 | } 30 | 31 | RefSys RefSys::relRotate(double x, double y, double z){ 32 | _trans.relRotate(x,y,z); 33 | return *this; 34 | } 35 | 36 | RefSys RefSys::relTranslate(double x, double y, double z){ 37 | _trans.relTranslate(x,y,z); 38 | return *this; 39 | } 40 | 41 | RefSys RefSys::rotate(double x, double y, double z){ 42 | _trans.rotate(x,y,z); 43 | return *this; 44 | } 45 | 46 | RefSys RefSys::rotateEulerZYZ(double z, double yp, double zpp){ 47 | _trans.rotateEulerZYZ(z,yp,zpp); 48 | return *this; 49 | } 50 | 51 | RefSys RefSys::rotateEulerZXZ(double z, double xp, double zpp){ 52 | _trans.rotateEulerZXZ(z,xp,zpp); 53 | return *this; 54 | } 55 | 56 | 57 | RefSys RefSys::relRotateEulerZYZ(double z, double yp, double zpp){ 58 | _trans.relRotateEulerZYZ(z,yp,zpp); 59 | return *this; 60 | } 61 | 62 | RefSys RefSys::relRotateEulerZXZ(double z, double xp, double zpp){ 63 | _trans.relRotateEulerZXZ(z,xp,zpp); 64 | return *this; 65 | } 66 | 67 | RefSys RefSys::transform(TransformMatrix tr){ 68 | _trans.transform(tr); 69 | return *this; 70 | } 71 | 72 | RefSys RefSys::relTransform(TransformMatrix tr){ 73 | _trans.relTransform(tr); 74 | return *this; 75 | } 76 | 77 | -------------------------------------------------------------------------------- /src/core/RotateExtrudeDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void RotateExtrudeDecorator::genScad(IndentWriter& writer) const 24 | { 25 | writer << "rotate_extrude(convexity=" << _convexity << ", $fn=" << _faces << ") {" << std::endl; 26 | { 27 | IndentBlock block(writer); 28 | ObjectDecorator::genScad(writer); 29 | } 30 | writer << "} // End rotate_extrude" << std::endl; 31 | } 32 | 33 | void RotateExtrudeDecorator::printAst(IndentWriter& writer) const 34 | { 35 | writer << "// ROTATE_EXTRUDE(" << _convexity << ", " << _faces << ")" << std::endl; 36 | ObjectDecorator::printAst(writer); 37 | } 38 | -------------------------------------------------------------------------------- /src/core/ScaleDecorator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | void ScaleDecorator::genScad(IndentWriter& writer) const 24 | { 25 | writer << "scale(v=[" << _sx << ", " << _sy << ", " << _sz << "]) {" << std::endl; 26 | { 27 | IndentBlock block(writer); 28 | ObjectDecorator::genScad(writer); 29 | } 30 | writer << "} // End scale" << std::endl; 31 | } 32 | 33 | void ScaleDecorator::printAst(IndentWriter& writer) const 34 | { 35 | writer << "SCALE(" << _sx << ", " << _sy << ", " << _sz << ")" << std::endl; 36 | ObjectDecorator::printAst(writer); 37 | } 38 | -------------------------------------------------------------------------------- /src/core/SphereObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "SphereObject.h" 21 | #include "IndentWriter.h" 22 | 23 | #include 24 | 25 | void SphereObject::genScad(IndentWriter& writer) const 26 | { 27 | writer << "sphere(r=" << _radius << ", $fn=" << _faces << ");" << std::endl; 28 | } 29 | 30 | void SphereObject::printAst(IndentWriter& writer) const 31 | { 32 | writer << "// SPHERE(" << _radius << ", " << _faces << ")" << std::endl; 33 | } 34 | -------------------------------------------------------------------------------- /src/core/Translation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OOML_TRANSLATION_H_INCLUDED 21 | #define OOML_TRANSLATION_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLCore_EXPORTS 25 | #define OOMLCore_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLCore_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLCore_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * \brief Translation Vector 38 | * 39 | * This class provides a translation vector 40 | */ 41 | class OOMLCore_EXP_DEC Translation 42 | { 43 | public: 44 | /** 45 | * \brief Default constructor. 46 | */ 47 | Translation() : 48 | x(0),y(0),z(0) 49 | { 50 | } 51 | 52 | Translation(double x, double y, double z) : x(x),y(y),z(z) 53 | {} 54 | 55 | 56 | /** 57 | * \brief Translates the current vector 58 | * \param tx translation along x axis. 59 | * \param ty translation along y axis. 60 | * \param tz translation along z axis. 61 | */ 62 | inline void translate(double tx, double ty, double tz){ 63 | x+=tx; 64 | y+=ty; 65 | z+=tz; 66 | } 67 | 68 | inline Translation operator+(Translation const& rhs) const 69 | { 70 | return Translation(x + rhs.x 71 | , y + rhs.y 72 | , z + rhs.z); 73 | } 74 | 75 | 76 | 77 | double x,y,z; 78 | 79 | 80 | }; 81 | 82 | #endif // TRANSLATION_H_INCLUDED 83 | -------------------------------------------------------------------------------- /src/core/Triangle3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef TRIANGLE3D_H_INCLUDED 21 | #define TRIANGLE3D_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLCore_EXPORTS 25 | #define OOMLCore_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLCore_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLCore_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * \brief 3D triangle primitive object 38 | * 39 | * This class provides a 3D triangle. 40 | */ 41 | class OOMLCore_EXP_DEC Triangle3D : public Polygon 42 | { 43 | public: 44 | /** 45 | * \brief Default parametrized constructor. 46 | * 47 | * \param p First point of the triangle. 48 | * \param q Second point of the triangle. 49 | * \param r Third point of the triangle. 50 | */ 51 | Triangle3D(Point3D const& p, Point3D const& q, Point3D const& r) : 52 | Polygon() 53 | { 54 | addPoint(p); 55 | addPoint(q); 56 | addPoint(r); 57 | } 58 | /** 59 | * \brief Default destructor. 60 | */ 61 | virtual ~Triangle3D() {} 62 | }; 63 | 64 | #endif // TRIANGLE3D_H_INCLUDED 65 | -------------------------------------------------------------------------------- /src/core/Union.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | 25 | Links Union::getLinks() const { 26 | //std::cout << "I am here" << std::endl; 27 | Links lks1; 28 | 29 | if (hasLinks()){ //If the Union Component has links return all its links and all the children links 30 | lks1 = AbstractObject::getLinks(); 31 | } 32 | 33 | for (int j=0;j<_children.size();j++){ 34 | Links lks2 = _children[j]->getLinks(); 35 | lks1.insert( lks1.end(), lks2.begin(), lks2.end() ); 36 | } 37 | 38 | return lks1; 39 | } 40 | 41 | RefSys Union::getLink(int i) const { 42 | Links lks1, lks2; 43 | 44 | if (hasLinks()){ //If the Union Component has links return all its links and all the children links 45 | lks1 = AbstractObject::getLinks(); 46 | } 47 | 48 | for (int j=0;j<_children.size();j++){ 49 | lks2 = _children[j]->getLinks(); 50 | lks1.insert( lks1.end(), lks2.begin(), lks2.end() ); 51 | } 52 | 53 | return lks1[i]; 54 | } 55 | 56 | 57 | void Union::genScad(IndentWriter& writer) const 58 | { 59 | writer << "union() {" << std::endl; 60 | { 61 | IndentBlock block(writer); 62 | CompositeObject::genScad(writer); 63 | } 64 | writer << "} // End union" << std::endl; 65 | } 66 | 67 | void Union::printAst(IndentWriter& writer) const 68 | { 69 | writer << "// UNION()" << std::endl; 70 | { 71 | IndentBlock block(writer); 72 | CompositeObject::printAst(writer); 73 | } 74 | } 75 | 76 | Component operator+(Component const& lhs, Component const& rhs) 77 | { 78 | CompositeComponent result(Union::create()); 79 | result << lhs.get() << rhs.get(); 80 | return result; 81 | } 82 | -------------------------------------------------------------------------------- /src/core/globalfunctions.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include "globalfunctions.h" 21 | #include "RefSys.h" 22 | #include "Translation.h" 23 | #include "RotMatrix.h" 24 | #include "Union.h" 25 | #include "Component.h" 26 | 27 | Component& attach(Component &base, int link_base, Component & attachment, int link_attach){ 28 | return base.attach(link_base,attachment,link_attach); 29 | } 30 | -------------------------------------------------------------------------------- /src/core/globalfunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef OOML_GLOBAL_FUNCTIONS_H_INCLUDED 21 | #define OOML_GLOBAL_FUNCTIONS_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLCore_EXPORTS 25 | #define OOMLCore_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLCore_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLCore_EXP_DEC 31 | #endif 32 | 33 | class Component; 34 | 35 | /** 36 | * \brief Attaches two components 37 | * This method attaches attachment component to base componet, making the links fit together 38 | * \param base Base Component. Remains unmoved 39 | * \param link_base. The id number of the link to attach. 40 | * \param attachment. The component to attach. It will be rotated and translated. 41 | * \param link_attach. The link of the attachment we want to place at the link of the base. By default the center of the attachment 42 | * \return An Union of base and attachment 43 | */ 44 | OOMLCore_EXP_DEC Component& attach(Component& base, int link_base, Component& attachment, int link_attach=0); 45 | 46 | 47 | 48 | #endif // OOML_GLOBAL_FUNCTIONS_H_INCLUDED 49 | -------------------------------------------------------------------------------- /src/parts.h: -------------------------------------------------------------------------------- 1 | #ifndef PARTS_H 2 | #define PARTS_H 3 | 4 | #include "parts/ArduinoUNO.h" 5 | #include "parts/BallWheelHolder.h" 6 | #include "parts/BatteryHolder.h" 7 | #include "parts/FutabaS3003.h" 8 | #include "parts/Link.h" 9 | #include "parts/NineVoltBattery.h" 10 | #include "parts/ServoWheel.h" 11 | #include "parts/SimpleAxe.h" 12 | #include "parts/SimpleWheel.h" 13 | #include "parts/SeeedUSSensor.h" 14 | #include "parts/SharpIRSensor.h" 15 | #include "parts/Nuts.h" 16 | #include "parts/Bearings.h" 17 | #include "parts/StepperMotors.h" 18 | #include "parts/GenericServo.h" 19 | #include "parts/SMS4303RServo.h" 20 | 21 | #endif // PARTS_H 22 | -------------------------------------------------------------------------------- /src/parts/BatteryHolder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | Component BatteryHolder::build() 27 | { 28 | double length, diameter, width; 29 | switch(_type) 30 | { 31 | case A23: length = 28.5; diameter = 10.3; break; 32 | case AAAA: length = 42.5; diameter = 8.3; break; 33 | case AAA: length = 44.5; diameter = 10.5; break; 34 | case AA: length = 50.5; diameter = 14.5; break; 35 | case C: length = 50; diameter = 26.2; break; 36 | case D: length = 61.5; diameter = 34.2; break; 37 | } 38 | ++length; // one millimeter of tolerance 39 | 40 | width = _number * diameter + (_number - 1) * 1.5; 41 | 42 | Component a(Cube(width + _thickness, _thickness + length, 3 + diameter).translate(0, 0, -1.5) 43 | - Cube(width, length, diameter).translate(0, 0, diameter / 2)); 44 | 45 | Component b1(Cylinder(1.5, 3 * _thickness) 46 | + Cylinder(2.5, 2.5, 2, 6, true).translate(0,0,-0.75)); 47 | Component b2(b1.rotatedCopy(90,0,0).translate((width/2) - (diameter/2), -1 - (length/2), 0)); 48 | b1.rotate(-90,0,0).translate((width/2) - (diameter/2), (length/2) + 1, 0); 49 | 50 | Component battery(Cylinder(diameter / 2, length) 51 | .rotate(90,0,0).translate((width / 2) - (diameter/2), 0, 0)); 52 | 53 | for(int i = 0; i < _number; ++i) 54 | { 55 | a = a 56 | - battery.translatedCopy(-i * (diameter + 1.5), 0, 0) 57 | - b1.translatedCopy(-i * (diameter + 1.5), 0, 0) 58 | - b2.translatedCopy(-i * (diameter + 1.5), 0, 0); 59 | } 60 | 61 | return a.translate(0, 0, 3 + diameter / 2); 62 | } 63 | -------------------------------------------------------------------------------- /src/parts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | cmake_policy(SET CMP0011 NEW) 3 | 4 | # Create parts library 5 | file(GLOB PARTS_SOURCES "*.h" "*.cpp") 6 | add_library(OOMLParts SHARED ${PARTS_SOURCES}) 7 | target_link_libraries(OOMLParts OOMLCore OOMLComponents) 8 | 9 | # Install parts library 10 | install(TARGETS OOMLParts DESTINATION lib) 11 | file(GLOB PARTS_HEADERS "*.h") 12 | install(FILES ${PARTS_HEADERS} DESTINATION include/ooml/parts) 13 | -------------------------------------------------------------------------------- /src/parts/DummyPart.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | 24 | Component DummyPart::build() 25 | { 26 | Component part = Cube(data.sx,data.sy,data.sz); 27 | return part; 28 | } 29 | -------------------------------------------------------------------------------- /src/parts/DummyPart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef DUMMYPART_H_INCLUDED 21 | #define DUMMYPART_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLParts_EXPORTS 25 | #define OOMLParts_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLParts_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLParts_EXP_DEC 31 | #endif 32 | 33 | #include 34 | 35 | /** 36 | * \brief DummyPart 37 | * 38 | * This class provides a DummyPart that can be used as template for other parts. 39 | */ 40 | class OOMLParts_EXP_DEC DummyPart : public AbstractPart 41 | { 42 | public: 43 | 44 | /** 45 | * @brief The Data struct 46 | */ 47 | struct Data{ 48 | double sx; //!< x dimension (mm) 49 | double sy; //!< y dimension (mm) 50 | double sz; //!< z dimension (mm) 51 | }; 52 | 53 | /** 54 | * \brief Default parametrized constructor. 55 | * 56 | * \param sx x size(mm). 57 | * \param sy y size(mm). 58 | * \param sz z size(mm). 59 | */ 60 | DummyPart(double sx, double sy, double sz): 61 | AbstractPart() 62 | { 63 | if (sx<=0) sx=1; 64 | if (sy<=0) sy=1; 65 | if (sz<=0) sz=1; 66 | 67 | data.sx=sx; 68 | data.sy=sy; 69 | data.sz=sz; 70 | 71 | rebuild(); 72 | } 73 | /** 74 | * \brief Default destructor. 75 | */ 76 | virtual ~DummyPart() {} 77 | 78 | inline Data getData(){ return data;} 79 | protected: 80 | /** 81 | * \brief Build the piece. 82 | * 83 | * This method build the piece from simpler objects. 84 | * 85 | * \return The piece built. 86 | * 87 | * \note Complete the link, now it's incomplete. 88 | */ 89 | virtual Component build(); 90 | 91 | private: 92 | Data data; 93 | }; 94 | 95 | #endif // LINK_H_INCLUDED 96 | -------------------------------------------------------------------------------- /src/parts/FutabaS3003.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef FUTABAS3003_H_INCLUDED 21 | #define FUTABAS3003_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLParts_EXPORTS 25 | #define OOMLParts_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLParts_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLParts_EXP_DEC 31 | #endif 32 | 33 | #include 34 | 35 | /** 36 | * \brief Futaba S3003 Bounding Box 37 | * 38 | * This class provides a Futaba S3003 Bounding Box. 39 | */ 40 | class OOMLParts_EXP_DEC FutabaS3003 : public AbstractPart 41 | { 42 | public: 43 | 44 | /** 45 | * Crown type enumeration. 46 | */ 47 | enum CrownType 48 | { 49 | NONE = 0 /** Rounded crown type */ 50 | , FOUR = 1 /** Four arms crown type */ 51 | , SIX = 2 /** Six arms crown type */ 52 | }; 53 | 54 | /** 55 | * \brief Default constructor. 56 | */ 57 | FutabaS3003(bool fill = true, bool cable_hole=true, int type = 0) : 58 | AbstractPart(), _fill_hole(fill), _cable_hole(cable_hole), _type(type) 59 | { 60 | rebuild(); 61 | } 62 | /** 63 | * \brief returns a component only with the crown 64 | * \param height Height of the crown 65 | * \return crown 66 | * 67 | * \note Create another component for the crown only and then use it in this one. 68 | */ 69 | static Component getCrown(int type=0, double height=3, bool fill_hole=false); 70 | 71 | /** 72 | * \brief Default destructor. 73 | */ 74 | virtual ~FutabaS3003() {} 75 | 76 | protected: 77 | /** 78 | * \brief Build the piece. 79 | * 80 | * This method build the piece from simpler objects. 81 | * 82 | * \return The piece built. 83 | */ 84 | virtual Component build(); 85 | 86 | private: 87 | bool _fill_hole; 88 | bool _cable_hole; 89 | int _type; 90 | }; 91 | 92 | #endif // FUTABAS3003_H_INCLUDED 93 | -------------------------------------------------------------------------------- /src/parts/FutabaWheel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | Component FutabaWheel::build() 27 | { 28 | return SimpleWheel(_radius, _thickness, 4.25) 29 | - FutabaS3003::getCrown(_crownType, 3, true).translate(0, 0, _thickness - 1.5); 30 | } 31 | -------------------------------------------------------------------------------- /src/parts/HCSR04.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/parts/HCSR04.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | 21 | #ifndef HCSR04_H_INCLUDED 22 | #define HCSR04_H_INCLUDED 23 | 24 | #ifdef WIN32 25 | #ifdef OOMLParts_EXPORTS 26 | #define OOMLParts_EXP_DEC __declspec(dllexport) 27 | #else 28 | #define OOMLParts_EXP_DEC __declspec(dllimport) 29 | #endif 30 | #else 31 | #define OOMLParts_EXP_DEC 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | /** 39 | * \brief Seeed Ultrasonic Sensor Model 40 | * 41 | * This class provides a Seeed Ultrasonic Sensor Model 42 | * http://www.seeedstudio.com 43 | */ 44 | class OOMLParts_EXP_DEC HCSR04USSensor : public USSensor 45 | { 46 | public: 47 | 48 | /** 49 | * \brief Default constructor. 50 | * \param fill_drills Fill Drill with Cylinder 51 | */ 52 | HCSR04USSensor(bool fill_drills = false) : 53 | USSensor(45,20,15,2,40,15,0.75,8.4,13.5,fill_drills) 54 | { 55 | rebuild(); 56 | } 57 | /** 58 | * \brief Default destructor. 59 | */ 60 | virtual ~HCSR04USSensor() {} 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/parts/Link.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | Component Link::build() 25 | { 26 | return Cylinder(_radius, _thickness) 27 | - Cylinder(_axeRadius, _thickness + PART_MARGIN); 28 | } 29 | -------------------------------------------------------------------------------- /src/parts/Link.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef LINK_H_INCLUDED 21 | #define LINK_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLParts_EXPORTS 25 | #define OOMLParts_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLParts_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLParts_EXP_DEC 31 | #endif 32 | 33 | #include 34 | 35 | /** 36 | * \brief link primitive object 37 | * 38 | * This class provides a link. 39 | */ 40 | class OOMLParts_EXP_DEC Link : public AbstractPart 41 | { 42 | public: 43 | /** 44 | * \brief Default constructor. 45 | */ 46 | Link() : 47 | AbstractPart(), 48 | _radius(1), 49 | _axeRadius(0.1), 50 | _thickness(0.1) 51 | {} 52 | /** 53 | * \brief Default parametrized constructor. 54 | * 55 | * \param radius Wheel radius. 56 | * \param axeRadius Wheel's axe radius. 57 | * \param thickness Wheel thickness. 58 | */ 59 | Link(double radius, double axeRadius, double thickness) : 60 | AbstractPart(), 61 | _radius(radius), 62 | _axeRadius(axeRadius), 63 | _thickness(thickness) 64 | { 65 | if (_axeRadius > _radius) 66 | _axeRadius = _radius - PART_MARGIN; 67 | rebuild(); 68 | } 69 | /** 70 | * \brief Default destructor. 71 | */ 72 | virtual ~Link() {} 73 | 74 | protected: 75 | /** 76 | * \brief Build the piece. 77 | * 78 | * This method build the piece from simpler objects. 79 | * 80 | * \return The piece built. 81 | * 82 | * \note Complete the link, now it's incomplete. 83 | */ 84 | virtual Component build(); 85 | 86 | private: 87 | double _radius; /** Wheel radius. */ 88 | double _axeRadius; /** Wheel's axe radius. */ 89 | double _thickness; /** Wheel thickness. */ 90 | }; 91 | 92 | #endif // LINK_H_INCLUDED 93 | -------------------------------------------------------------------------------- /src/parts/NineVoltBattery.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | Component NineVoltBattery::build() 28 | { 29 | _data.sx = 26.32; // 26.32; 30 | _data.sy = 17.26; // 17.26; 31 | _data.sz = 45.30; // 45.30; 32 | 33 | _data.connector_r = 5; 34 | _data.connector_lenght = 3.20; 35 | _data.connect_width = 22; 36 | 37 | Component battery = RoundedTablet(_data.sx , _data.sy , _data.sz , 2); 38 | Component connector = RoundedTablet(_data.connect_width , 2*_data.connector_r , _data.connector_lenght , 2*_data.connector_r); 39 | connector.translate( 0 , 0 , _data.sz/2 + _data.connector_lenght/2); 40 | battery = battery + connector; 41 | 42 | return battery; 43 | } 44 | -------------------------------------------------------------------------------- /src/parts/NineVoltBattery.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef NINEVOLTBATTERY_H_INCLUDED 21 | #define NINEVOLTBATTERY_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLParts_EXPORTS 25 | #define OOMLParts_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLParts_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLParts_EXP_DEC 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | /** 37 | * \brief Nine volt Battery Model 38 | * 39 | * This class provides a Nine Volt Battery Model. 40 | */ 41 | class OOMLParts_EXP_DEC NineVoltBattery : public AbstractPart 42 | { 43 | public: 44 | 45 | struct Data{ 46 | double sx; 47 | double sy; 48 | double sz; 49 | 50 | double connector_r; 51 | double connector_lenght; 52 | double connect_width; 53 | 54 | }; 55 | 56 | /** 57 | * \brief Default constructor. 58 | */ 59 | NineVoltBattery() : 60 | AbstractPart() 61 | { 62 | rebuild(); 63 | } 64 | /** 65 | * \brief Default destructor. 66 | */ 67 | virtual ~NineVoltBattery() {} 68 | 69 | 70 | inline virtual Data getData(){ return _data; } 71 | 72 | protected: 73 | /** 74 | * \brief Build the piece. 75 | * 76 | * This method build the piece from simpler objects. 77 | * 78 | * \return The piece built. 79 | */ 80 | virtual Component build(); 81 | 82 | Data _data; 83 | }; 84 | 85 | #endif // NINEVOLT_H_INCLUDED 86 | -------------------------------------------------------------------------------- /src/parts/Nuts.cpp: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * 3 | * This code is part of the RepRapQuijote project 4 | * Authors: Alberto Valero-Gomez 5 | * 6 | * OOML is licenced under the Common Creative License, 7 | * Attribution-ShareAlike 3.0 8 | * 9 | * You are free: 10 | * - to Share - to copy, distribute and transmit the work 11 | * - to Remix - to adapt the work 12 | * 13 | * Under the following conditions: 14 | * - Attribution. You must attribute the work in the manner specified 15 | * by the author or licensor (but not in any way that suggests that 16 | * they endorse you or your use of the work). 17 | * - Share Alike. If you alter, transform, or build upon this work, 18 | * you may distribute the resulting work only under the same or 19 | * similar license to this one. 20 | * 21 | * Any of the above conditions can be waived if you get permission 22 | * from the copyright holder. Nothing in this license impairs or 23 | * restricts the author's moral rights. 24 | * 25 | * It is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied 27 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 28 | * PURPOSE. 29 | **********************************************************************/ 30 | 31 | 32 | 33 | #include "Nuts.h" 34 | #include "../components.h" 35 | 36 | NutShape::NutShape(Metric m, double thickness, double extra):AbstractPart() 37 | { 38 | data.dim_margin=extra; 39 | 40 | switch (m){ 41 | case M3: 42 | data.width_across_flats = 5.5; 43 | data.witdth_across_coners = 6.01; 44 | data.thickness = (thickness==0)?2.4:thickness; 45 | break; 46 | case M4: 47 | data.width_across_flats = 7; 48 | data.witdth_across_coners = 7.66; 49 | data.thickness = (thickness==0)?3.2:thickness; 50 | break; 51 | case M5: 52 | data.width_across_flats = 8; 53 | data.witdth_across_coners = 8.79; 54 | data.thickness = (thickness==0)?4.7:thickness; 55 | break; 56 | case M6: 57 | data.width_across_flats = 10; 58 | data.witdth_across_coners = 11.05; 59 | data.thickness = (thickness==0)?5.02:thickness; 60 | break; 61 | case M8: 62 | data.width_across_flats = 13; 63 | data.witdth_across_coners = 14.38; 64 | data.thickness = (thickness==0)?6.8:thickness; 65 | break; 66 | 67 | } 68 | //build the part 69 | rebuild(); 70 | } 71 | 72 | Component NutShape::build(){ 73 | Component hexnut = Cylinder((data.witdth_across_coners+data.dim_margin)/2 ,data.thickness,6,true); 74 | return hexnut; 75 | } 76 | -------------------------------------------------------------------------------- /src/parts/Nuts.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * 3 | * This code is part of the RepRap Plastic Valley project 4 | * Authors: Alberto Valero-Gomez 5 | * 6 | * OOML is licenced under the Common Creative License, 7 | * Attribution-ShareAlike 3.0 8 | * 9 | * You are free: 10 | * - to Share - to copy, distribute and transmit the work 11 | * - to Remix - to adapt the work 12 | * 13 | * Under the following conditions: 14 | * - Attribution. You must attribute the work in the manner specified 15 | * by the author or licensor (but not in any way that suggests that 16 | * they endorse you or your use of the work). 17 | * - Share Alike. If you alter, transform, or build upon this work, 18 | * you may distribute the resulting work only under the same or 19 | * similar license to this one. 20 | * 21 | * Any of the above conditions can be waived if you get permission 22 | * from the copyright holder. Nothing in this license impairs or 23 | * restricts the author's moral rights. 24 | * 25 | * It is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied 27 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 28 | * PURPOSE. 29 | **********************************************************************/ 30 | 31 | #ifndef OOML_NUTS_H 32 | #define OOML_NUTS_H 33 | 34 | #include "../core.h" 35 | 36 | #include 37 | 38 | #ifdef WIN32 39 | #ifdef OOMLParts_EXPORTS 40 | #define OOMLParts_EXP_DEC __declspec(dllexport) 41 | #else 42 | #define OOMLParts_EXP_DEC __declspec(dllimport) 43 | #endif 44 | #else 45 | #define OOMLParts_EXP_DEC 46 | #endif 47 | 48 | enum Metric{M3,M4,M5,M6,M8}; 49 | 50 | class OOMLParts_EXP_DEC NutShape : public AbstractPart 51 | { 52 | public: 53 | 54 | /** 55 | * Part Data 56 | */ 57 | struct Data{ 58 | double width_across_flats; // (mm) 59 | double witdth_across_coners; //. 17 | * 18 | */ 19 | 20 | #ifndef SMS4303R_SERVO_H_INCLUDED 21 | #define SMS4303R_SERVO_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLParts_EXPORTS 25 | #define OOMLParts_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLParts_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLParts_EXP_DEC 31 | #endif 32 | 33 | #include "GenericServo.h" 34 | 35 | /** 36 | * \brief Generic Servo Model 37 | * 38 | * This class provides a Generic Servo Model 39 | */ 40 | class OOMLParts_EXP_DEC SMS4303RServo : public GenericServo 41 | { 42 | public: 43 | 44 | /* MEMBER FUNCTIONS */ 45 | 46 | /** 47 | * @brief SM-S4303RServoServo 48 | * @param fill 49 | * @param cable_space 50 | * @param crown 51 | */ 52 | SMS4303RServo(bool fill = true, bool cable_space=true, double fill_length=10); 53 | 54 | /** 55 | * \brief Default destructor. 56 | */ 57 | virtual ~SMS4303RServo() {} 58 | 59 | /** 60 | * @brief getBackCover 61 | * @return BackCover of this precise servo model 62 | */ 63 | virtual Component getBackCover(); 64 | }; 65 | 66 | #endif // OOML_GENERIC_SERVO_H_INCLUDED 67 | -------------------------------------------------------------------------------- /src/parts/SeeedUSSensor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/parts/SeeedUSSensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | 21 | #ifndef SEEEDUSSENSOR_H_INCLUDED 22 | #define SEEEDUSSENSOR_H_INCLUDED 23 | 24 | #ifdef WIN32 25 | #ifdef OOMLParts_EXPORTS 26 | #define OOMLParts_EXP_DEC __declspec(dllexport) 27 | #else 28 | #define OOMLParts_EXP_DEC __declspec(dllimport) 29 | #endif 30 | #else 31 | #define OOMLParts_EXP_DEC 32 | #endif 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | /** 39 | * \brief Seeed Ultrasonic Sensor Model 40 | * 41 | * This class provides a Seeed Ultrasonic Sensor Model 42 | * http://www.seeedstudio.com 43 | */ 44 | class OOMLParts_EXP_DEC SeeedUSSensor : public USSensor 45 | { 46 | public: 47 | 48 | /** 49 | * \brief Default constructor. 50 | * \param fill_drills Fill Drill with Cylinder 51 | */ 52 | SeeedUSSensor(bool fill_drills = true) : 53 | USSensor(43,20,15,2,40,17,1,16.1/2,20-16.1/2,fill_drills) 54 | { 55 | rebuild(); 56 | } 57 | /** 58 | * \brief Default destructor. 59 | */ 60 | virtual ~SeeedUSSensor() {} 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/parts/ServoWheel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | Component ServoWheel::build() 26 | { 27 | return get() // Get the SimpleWheel we inherit from 28 | - Cylinder(_servoRadius, _servoThickness + PART_MARGIN,50,false) 29 | .translate(0, 0, getThickness() - (_servoThickness - PART_MARGIN)); 30 | } 31 | -------------------------------------------------------------------------------- /src/parts/SimpleAxe.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | Component SimpleAxe::build() 24 | { 25 | return Cylinder(_radius, _length); 26 | } 27 | -------------------------------------------------------------------------------- /src/parts/SimpleAxe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #ifndef SIMPLEAXE_H_INCLUDED 21 | #define SIMPLEAXE_H_INCLUDED 22 | 23 | #ifdef WIN32 24 | #ifdef OOMLParts_EXPORTS 25 | #define OOMLParts_EXP_DEC __declspec(dllexport) 26 | #else 27 | #define OOMLParts_EXP_DEC __declspec(dllimport) 28 | #endif 29 | #else 30 | #define OOMLParts_EXP_DEC 31 | #endif 32 | 33 | #include 34 | 35 | /** 36 | * \brief Simple axe primitive object 37 | * 38 | * This class provides a simple axe. 39 | */ 40 | class OOMLParts_EXP_DEC SimpleAxe : public AbstractPart 41 | { 42 | public: 43 | /** 44 | * \brief Default constructor. 45 | */ 46 | SimpleAxe() : 47 | AbstractPart(), 48 | _length(1), 49 | _radius(0.1) 50 | { 51 | rebuild(); 52 | } 53 | /** 54 | * \brief Default parametrized constructor. 55 | * 56 | * \param length Axe length. 57 | * \param radius Axe radius. 58 | */ 59 | SimpleAxe(double length, double radius) : 60 | AbstractPart(), 61 | _length(length), 62 | _radius(radius) 63 | { 64 | rebuild(); 65 | } 66 | /** 67 | * \brief Default destructor. 68 | */ 69 | virtual ~SimpleAxe() {} 70 | 71 | protected: 72 | /** 73 | * \brief Build the piece. 74 | * 75 | * This method build the piece from simpler objects. 76 | * 77 | * \return The piece built. 78 | */ 79 | virtual Component build(); 80 | 81 | private: 82 | double _length; /** Axe length. */ 83 | double _radius; /** Axe radius. */ 84 | }; 85 | 86 | #endif // SIMPLEAXE_H_INCLUDED 87 | -------------------------------------------------------------------------------- /src/parts/SimpleWheel.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | Component SimpleWheel::build() 25 | { 26 | return Cylinder(_radius, _thickness,100,false) 27 | - Cylinder(_axeRadius, _thickness + PART_MARGIN,20,false) 28 | .translate(0,0,-PART_MARGIN); 29 | } 30 | -------------------------------------------------------------------------------- /src/parts/StepperMotors.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | #include "StepperMotors.h" 20 | 21 | #include "../core.h" 22 | #include "../components.h" 23 | 24 | StepperMotor::StepperMotor(StepperMotorType type):AbstractPart(){ 25 | switch(type){ 26 | case Nema17: 27 | data.x_dim_body=42.3; 28 | data.y_dim_body=42.3; 29 | data.z_dim_body=47; 30 | data.drills_distance=31; 31 | data.shaft_d=5; 32 | data.shaft_length=24; 33 | data.shaft_base_d=22; 34 | data.shaft_base_thickness=2; 35 | 36 | rebuild(); 37 | } 38 | } 39 | 40 | Component StepperMotor::build(){ 41 | Component motor = Cube(data.x_dim_body,data.y_dim_body,data.z_dim_body) 42 | + Cylinder(data.shaft_d/2,data.shaft_length,20,false).translate(0,0,data.z_dim_body/2) 43 | + Cylinder(data.shaft_base_d/2,data.shaft_base_thickness,20,false).translate(0,0,data.z_dim_body/2) 44 | ; 45 | 46 | for(int i=-1;i<=1;i+=2){ 47 | for (int j=-1;j<=1;j+=2){ 48 | motor = motor 49 | - Cylinder(1.5,5,20,false).translate(i*data.drills_distance/2,j*data.drills_distance/2,data.z_dim_body/2-4.9) 50 | ; 51 | } 52 | } 53 | 54 | motor.translate(0,0,-data.z_dim_body/2); 55 | return motor; 56 | } 57 | -------------------------------------------------------------------------------- /src/parts/StepperMotors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | #ifndef OOML_STEPPERMOTOR_H 20 | #define OOML_STEPPERMOTOR_H_H 21 | 22 | #include "../core.h" 23 | 24 | #include 25 | 26 | #ifdef WIN32 27 | #ifdef OOMLParts_EXPORTS 28 | #define OOMLParts_EXP_DEC __declspec(dllexport) 29 | #else 30 | #define OOMLParts_EXP_DEC __declspec(dllimport) 31 | #endif 32 | #else 33 | #define OOMLParts_EXP_DEC 34 | #endif 35 | 36 | enum StepperMotorType{Nema17}; 37 | 38 | class OOMLParts_EXP_DEC StepperMotor : public AbstractPart 39 | { 40 | public: 41 | /** 42 | * Part Data 43 | */ 44 | struct Data{ 45 | double x_dim_body; 46 | double y_dim_body; 47 | double z_dim_body; 48 | double drills_distance; 49 | double shaft_d; 50 | double shaft_length; 51 | double shaft_base_d; 52 | double shaft_base_thickness; 53 | }; 54 | 55 | /** 56 | * Constructor 57 | */ 58 | StepperMotor(StepperMotorType type); 59 | 60 | /** 61 | * \brief returns part data 62 | * \return part data 63 | */ 64 | inline const Data getData() const{return data;} 65 | 66 | protected: 67 | /** 68 | * \brief Build the piece. 69 | * 70 | * This method build the piece from simpler objects. 71 | * 72 | * \return The piece built. 73 | */ 74 | virtual Component build(); 75 | 76 | private: 77 | Data data; 78 | }; 79 | 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /src/parts/USSensor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * OOML : Object Oriented Mechanics Library 3 | * Copyright (C) 2012 Alberto Valero Gomez, Juan González Gómez, Rafael Treviño 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU Lesser General Public License (LGPL) as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU Lesser General Public License (LGPL) for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public License (LGPL) 16 | * along with this program. If not, see . 17 | * 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | 29 | Component USSensor::build() 30 | { 31 | Component us = Cube(data.sx,data.sy,data.board_thickness,true).translate(0,0,data.board_thickness/2) //board 32 | + Cylinder(data.sensor_radius + 1.5*PART_MARGIN,data.sz,100,false).translate(data.sensor_dist_to_center,0,0) //us1 33 | + Cylinder(data.sensor_radius + 1.5*PART_MARGIN,data.sz,100,false).translate(-data.sensor_dist_to_center,0,0); //us2 34 | 35 | 36 | Component drills = Cylinder(data.drills_radius+PART_MARGIN,12,20,false) 37 | .translate(data.drills_x_dist/2,data.drills_y_dist/2,-5) 38 | + Cylinder(data.drills_radius+PART_MARGIN,12,20,false) 39 | .translate(-data.drills_x_dist/2,data.drills_y_dist/2,-5) 40 | + Cylinder(data.drills_radius+PART_MARGIN,12,20,false) 41 | .translate(data.drills_x_dist/2,-data.drills_y_dist/2,-5) 42 | + Cylinder(data.drills_radius+PART_MARGIN,12,20,false) 43 | .translate(-data.drills_x_dist/2,-data.drills_y_dist/2,-5); 44 | 45 | if (_fill_drills){ 46 | us = us + drills; 47 | }else{ 48 | us = us - drills; 49 | } 50 | return us; 51 | } 52 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Add test executables 2 | add_executable(writer writer.cpp) 3 | target_link_libraries(writer OOMLCore) 4 | #install(TARGETS writer DESTINATION bin) 5 | 6 | # Add test executables 7 | add_executable(clamps clamps.cpp) 8 | target_link_libraries(clamps OOMLCore OOMLComponents) 9 | #install(TARGETS clamps DESTINATION bin) 10 | 11 | # Add test executables 12 | add_executable(sharedptr sharedptr.cpp) 13 | target_link_libraries(sharedptr) 14 | #install(TARGETS sharedptr DESTINATION bin) 15 | 16 | # Add test executables 17 | add_executable(cube cube.cpp) 18 | target_link_libraries(cube OOMLCore OOMLComponents OOMLParts) 19 | #install(TARGETS cube DESTINATION bin) 20 | 21 | # Add test executables 22 | add_executable(prism prism.cpp) 23 | target_link_libraries(prism OOMLCore OOMLComponents) 24 | #install(TARGETS prism DESTINATION bin) 25 | 26 | # Add test executables 27 | add_executable(regular regular.cpp) 28 | target_link_libraries(regular OOMLCore OOMLComponents) 29 | #install(TARGETS regular DESTINATION bin) 30 | 31 | # Add test executables 32 | add_executable(subsystem2D subsystem2D.cpp) 33 | target_link_libraries(subsystem2D OOMLCore OOMLComponents) 34 | #install(TARGETS subsystem2D DESTINATION bin) 35 | 36 | # Add test executables 37 | add_executable(toroid toroid.cpp) 38 | target_link_libraries(toroid OOMLCore OOMLComponents) 39 | #install(TARGETS toroid DESTINATION bin) 40 | 41 | # Add test executables 42 | add_executable(rounded rounded.cpp) 43 | target_link_libraries(rounded OOMLCore OOMLComponents) 44 | 45 | # Add test executables 46 | add_executable(refsys refsys.cpp) 47 | target_link_libraries(refsys OOMLCore OOMLComponents) 48 | 49 | # Add test executables 50 | add_executable(transform transform.cpp) 51 | target_link_libraries(transform OOMLCore OOMLComponents OOMLParts) 52 | 53 | # Add test executables 54 | add_executable(attachment attachment.cpp) 55 | target_link_libraries(attachment OOMLCore OOMLComponents OOMLParts) 56 | 57 | # Add test executables 58 | add_executable(sandbox sandbox.cpp) 59 | target_link_libraries(sandbox OOMLCore OOMLComponents OOMLParts) 60 | 61 | 62 | #install(TARGETS rounded DESTINATION bin) 63 | -------------------------------------------------------------------------------- /test/attachment.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char **argv) 8 | { 9 | std::ofstream file("attachment.scad"); 10 | IndentWriter writer; 11 | 12 | /* Create Cube */ 13 | Component cube1 = Cube(10,10,10); 14 | 15 | /* Add links to the Cube */ 16 | cube1.addLink(RefSys(5,-5,-5).relRotate(135,0,0)); 17 | // cube1.addLink(RefSys(5,5,-5).relRotate(225,0,0)); 18 | // cube1.addLink(RefSys(5,5,5).relRotate(-45,0,0)); 19 | // cube1.addLink(RefSys(5,-5,5).relRotate(45,0,0)); 20 | // cube1.addLink(RefSys(-5,5,5).relRotate(0,0,180).relRotate(45,0,0)); 21 | // cube1.addLink(RefSys(-5,-5,5).relRotate(0,0,180).relRotate(-45,0,0)); 22 | // cube1.addLink(RefSys(-5,-5,-5).relRotate(0,180,0).relRotate(45,0,0)); 23 | // cube1.addLink(RefSys(-5,5,-5).relRotate(0,180,0).relRotate(-45,0,0)); 24 | 25 | //Component cyl = Cylinder(3,50); 26 | 27 | //cube1.translate(5,0,0); 28 | 29 | cube1.addLink(RefSys(0,0,0)); 30 | 31 | Component cube2 = Cube(3,50,2); 32 | cube2.addLink(RefSys(1.5,25,1.5)); 33 | 34 | //cube1.translate(5,0,0); 35 | //cube1.rotate(0,0,45); 36 | 37 | Component ardu = ArduinoUNO(); 38 | 39 | Component wheel = SharpIRSensor(); 40 | 41 | wheel.addLink(RefSys(10,10,10)); 42 | 43 | Component comp = ardu + cube1; 44 | 45 | //comp.addLink(RefSys(20,20,20)); 46 | 47 | /* Generate OpenSCAD code and write to file */ 48 | writer << LinksView(comp); 49 | writer << comp; 50 | file << writer ; 51 | file.close(); 52 | std::cout << "Done" << std::endl; 53 | } 54 | -------------------------------------------------------------------------------- /test/clamps.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | int main(int argc, char **argv) 12 | { 13 | IndentWriter writer; 14 | 15 | Component main_body = RoundedTablet(70,38,6,3,true,true,true,true,20); 16 | Component main_hole = RoundedTablet(60,30,6.2,1,true,true,true,true,20); 17 | Component small_hole = RoundedTablet(16,30,6.2,1,true,true,true,true,20); 18 | main_body.translate(-5,0,0); 19 | main_hole.translate(-26,0,0); 20 | small_hole.translate(17,0,0); 21 | 22 | Component body = main_body - main_hole - small_hole; 23 | 24 | Component ext_ring = Cylinder(9,6,50,true); 25 | ext_ring.translate(30,19,0); 26 | 27 | Component int_ring = Cylinder(5,6.2,50,true); 28 | int_ring.translate(30,19,0); 29 | 30 | Component clamp = body + ext_ring - int_ring; 31 | 32 | writer << clamp; 33 | std::cout << writer; 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /test/cube.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | int main(int argc, char **argv) 10 | { 11 | IndentWriter writer; 12 | 13 | Component cube(Cube(10, 10, 10)); 14 | writer << cube; 15 | 16 | std::cout << writer; 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /test/prism.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | IndentWriter writer; 11 | Polygon base; 12 | 13 | base.addPoint(Point2D(1.0, 2.0)); 14 | base.addPoint(Point2D(1.0, -2.0)); 15 | base.addPoint(Point2D(-1.0, -1.0)); 16 | base.addPoint(Point2D(-2.0, 1.0)); 17 | 18 | Component prism(PolygonalPrism(base, 5.0)); 19 | 20 | writer << prism; 21 | std::cout << writer; 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /test/refsys.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | std::ofstream file("refsys.scad"); 11 | IndentWriter writer; 12 | 13 | 14 | Component comp = Cube(10,20,30); 15 | Component cyl = Cylinder(2,50); 16 | comp.translate(20,0,0); 17 | 18 | comp = comp + cyl; 19 | 20 | comp.translate(0,20,0); 21 | 22 | //comp.resetRefSys(); 23 | 24 | writer << "%"; 25 | writer << comp; 26 | writer << RefSysView(comp); 27 | 28 | file << writer; 29 | 30 | file.close(); 31 | 32 | std::cout << "Done" << std::endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /test/regular.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | int main(int argc, char **argv) 8 | { 9 | IndentWriter writer; 10 | Component prism(RegularPrism(5, 5.0, 5.0)); 11 | 12 | writer << prism; 13 | 14 | std::cout << writer; 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /test/rounded.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | int main(int argc, char **argv) 10 | { 11 | IndentWriter writer; 12 | 13 | Component roundedTablet(RoundedTablet(5.0, 5.0, 1.0, 1.0)); 14 | writer << roundedTablet; 15 | 16 | Component roundedCube(RoundedCube(5.0, 5.0, 5.0, 1.0)); 17 | writer << roundedCube; 18 | 19 | Component roundedCylinder(RoundedCylinder(5.0, 5.0, 1.0)); 20 | writer << roundedCylinder; 21 | 22 | Component roundedConicalFrustum(RoundedCylinder(7.0, 5.0, 5.0, 1.0)); 23 | writer << roundedConicalFrustum; 24 | 25 | std::cout << writer; 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /test/sandbox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(int argc, char **argv) 12 | { 13 | IndentWriter writer; 14 | 15 | Component cad = CylindricalSection(30,40,85,10,100,false); 16 | 17 | writer << cad; 18 | 19 | ofstream file("sandbox.scad"); 20 | file << writer; 21 | file.close(); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /test/sharedptr.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | SharedPtr b(new int(4)); 6 | SharedPtr c(b); 7 | 8 | b.reset(); 9 | 10 | c = b; 11 | 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /test/subsystem2D.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | IndentWriter writer; 11 | Component2D polygon(Polygon2D::create()); 12 | 13 | /* Create a square */ 14 | { 15 | Polygon2D & polygon2D = polygon.getRef(); 16 | polygon2D.addPoint(Point2D(-100.0, 100.0)); 17 | polygon2D.addPoint(Point2D(100.0, 100.0)); 18 | polygon2D.addPoint(Point2D(100.0, -100.0)); 19 | polygon2D.addPoint(Point2D(-100.0, -100.0)); 20 | } 21 | polygon.translate(5, 0, 0); 22 | 23 | Component extrudedComponent(polygon.linearExtrudedCopy(10)); 24 | 25 | writer << polygon; 26 | writer << extrudedComponent; 27 | std::cout << writer; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /test/toroid.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | int main(int argc, char **argv) 10 | { 11 | IndentWriter writer; 12 | Component2D circle(Circle::create(1.0).translate(2, 0, 0)); 13 | Component toroid(circle.rotateExtrudedCopy()); 14 | 15 | writer << toroid; 16 | 17 | Component toroid2(Toroid(2.0, 1.0)); 18 | 19 | writer << toroid2; 20 | std::cout << writer; 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /test/transform.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main(int argc, char **argv) 12 | { 13 | std::ofstream file("transform.scad"); 14 | IndentWriter writer; 15 | 16 | Component cube = Cube(10,10,10); 17 | 18 | cube.translate(10,10,10); 19 | //cube = cube + cube; 20 | // cube.scale(10); 21 | AbstractObject * abso = dynamic_cast(cube.get().get()); 22 | abso->getRefSys(); 23 | std::cout << " main --- main" << std::endl; 24 | cube.getRefSys(); 25 | 26 | // cube.translate(10,0,0); 27 | // cube.relRotate(45,0,0); 28 | // cube.translate(0,0,10); 29 | 30 | // cube = cube + cube; 31 | // writer << "% "; 32 | // writer << cube; 33 | std::cout << " RefSysView --- RefSysView" << std::endl; 34 | writer << RefSysView(cube); 35 | 36 | file << writer; 37 | 38 | file.close(); 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /test/writer.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | int main(int argc, char **argv) 7 | { 8 | IndentWriter writer(8); 9 | 10 | writer << "Hola mundo" << std::endl; 11 | 12 | writer.indent(); 13 | writer << 1 << ", " << 1.0 << std::endl; 14 | writer.unindent(); 15 | 16 | { 17 | IndentBlock block(writer); 18 | writer << 2 << ", " << 2.0 << std::endl; 19 | } 20 | 21 | writer << "Adios mundo" << std::endl; 22 | 23 | std::cout << writer; 24 | 25 | return 0; 26 | } 27 | --------------------------------------------------------------------------------