Skip to content

Commit

Permalink
Add step2wrl-occ
Browse files Browse the repository at this point in the history
See README.md
  • Loading branch information
metorm committed Jan 19, 2018
1 parent 7de09cf commit 4740ce5
Show file tree
Hide file tree
Showing 25 changed files with 259,916 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# 3D-format-converter

A colloction of 3D format converters, step->wrl, iges->obj/mtl, step->obj/mtl

# description list

## step2wrl-occ

**[Originally by twlostow](https://github.com/twlostow/step2wrl)**

A converter based on openCASCADE, which accepts `*.step` or `*.igs` and exports `*.wrl`.

I created a CMakeList to compile the project with `windows`/`openCASCADE 6.3.1`.

Problems TODO:
1. If the step is exported from UG and **some** of the faces are colored, then the un-colored faced are not exported. However, if **all** faces are uncolored, the output is OK; This shall be a logical problem in the code because all entities are loaded according to the verbose information of `occ`.
2. `*.igs` loading is unstable. There may be empty output.
55 changes: 55 additions & 0 deletions step2wrl-occ/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
cmake_minimum_required(VERSION 2.8.2)

set(PROJ_NAME "step2wrl")

# ==========================================
# This cmake file is for building the project with occ 6.3.1
# there is no stable cmake package
# so, edit following lines to set correct paths
set(OCC_MAIN_DIR "C:/OpenCASCADE6.3.0")
set(OCC_INCLUDE "${OCC_MAIN_DIR}/ros/inc")
set(OCC_LIB "${OCC_MAIN_DIR}/ros/win32/lib")
# ==========================================

# do not edit below unless you know what you are doing

cmake_policy(SET CMP0048 NEW)
project(${PROJ_NAME} VERSION 0.1.0 LANGUAGES CXX)

# set compiling parameters
include_directories(${OCC_INCLUDE})

set(CMAKE_CXX_FLAGS "/DWNT /EHsc")

set(SOURCE_FILES
s3d_model.cpp s3d_model.h
step_mesher.cpp step_mesher.h
vrml_writer.cpp)

set(LIBS_TO_LINK
PTKernel TKAdvTools TKBin TKBinL TKBinTObj
TKBinXCAF TKBO TKBool TKBRep TKCAF TKCDF
TKernel TKFeat TKFillet TKG2d TKG3d TKGeomAlgo
TKGeomBase TKHLR TKIGES TKLCAF TKMath TKMesh
TKMeshVS TKNIS TKOffset TKPCAF TKPLCAF TKPrim
TKPShape TKShapeSchema TKShHealing TKStdLSchema
TKStdSchema TKSTEP209 TKSTEP TKSTEPAttr TKSTEPBase
TKSTL TKTObj TKTopAlgo TKVRML TKXCAF
TKXCAFSchema TKXDEIGES TKXDESTEP TKXMesh TKXml
TKXmlL TKXmlTObj TKXmlXCAF TKXSBase TKService
TKOpenGl TKV3d)

add_executable(${PROJ_NAME} ${SOURCE_FILES})

foreach(targetLibrary ${LIBS_TO_LINK})
message(STATUS "Finding and linking ${targetLibrary} ...")

find_library(OCC_LIB_${targetLibrary} NAMES ${targetLibrary} PATHS ${OCC_LIB})

if(NOT OCC_LIB_${targetLibrary})
message(FATAL_ERROR "${targetLibrary} not found!")
endif()

target_link_libraries(${PROJ_NAME} ${OCC_LIB_${targetLibrary}})

endforeach(targetLibrary)
73 changes: 73 additions & 0 deletions step2wrl-occ/export-test/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
OCE_LIB_DIR=/usr/local/oce/lib


OCE_LIBS=$(OCE_LIB_DIR)/libFWOSPlugin.so \
$(OCE_LIB_DIR)/libPTKernel.so \
$(OCE_LIB_DIR)/libTKAdvTools.so \
$(OCE_LIB_DIR)/libTKBinL.so \
$(OCE_LIB_DIR)/libTKBin.so \
$(OCE_LIB_DIR)/libTKBinTObj.so \
$(OCE_LIB_DIR)/libTKBinXCAF.so \
$(OCE_LIB_DIR)/libTKBool.so \
$(OCE_LIB_DIR)/libTKBO.so \
$(OCE_LIB_DIR)/libTKBRep.so \
$(OCE_LIB_DIR)/libTKCAF.so \
$(OCE_LIB_DIR)/libTKCDF.so \
$(OCE_LIB_DIR)/libTKernel.so \
$(OCE_LIB_DIR)/libTKFeat.so \
$(OCE_LIB_DIR)/libTKFillet.so \
$(OCE_LIB_DIR)/libTKG2d.so \
$(OCE_LIB_DIR)/libTKG3d.so \
$(OCE_LIB_DIR)/libTKGeomAlgo.so \
$(OCE_LIB_DIR)/libTKGeomBase.so \
$(OCE_LIB_DIR)/libTKHLR.so \
$(OCE_LIB_DIR)/libTKIGES.so \
$(OCE_LIB_DIR)/libTKLCAF.so \
$(OCE_LIB_DIR)/libTKMath.so \
$(OCE_LIB_DIR)/libTKMesh.so \
$(OCE_LIB_DIR)/libTKMeshVS.so \
$(OCE_LIB_DIR)/libTKNIS.so \
$(OCE_LIB_DIR)/libTKOffset.so \
$(OCE_LIB_DIR)/libTKOpenGl.so \
$(OCE_LIB_DIR)/libTKPCAF.so \
$(OCE_LIB_DIR)/libTKPLCAF.so \
$(OCE_LIB_DIR)/libTKPrim.so \
$(OCE_LIB_DIR)/libTKPShape.so \
$(OCE_LIB_DIR)/libTKService.so \
$(OCE_LIB_DIR)/libTKShapeSchema.so \
$(OCE_LIB_DIR)/libTKShHealing.so \
$(OCE_LIB_DIR)/libTKStdLSchema.so \
$(OCE_LIB_DIR)/libTKStdSchema.so \
$(OCE_LIB_DIR)/libTKSTEP209.so \
$(OCE_LIB_DIR)/libTKSTEPAttr.so \
$(OCE_LIB_DIR)/libTKSTEPBase.so \
$(OCE_LIB_DIR)/libTKSTEP.so \
$(OCE_LIB_DIR)/libTKSTL.so \
$(OCE_LIB_DIR)/libTKTObj.so \
$(OCE_LIB_DIR)/libTKTopAlgo.so \
$(OCE_LIB_DIR)/libTKV3d.so \
$(OCE_LIB_DIR)/libTKVoxel.so \
$(OCE_LIB_DIR)/libTKVRML.so \
$(OCE_LIB_DIR)/libTKXCAFSchema.so \
$(OCE_LIB_DIR)/libTKXCAF.so \
$(OCE_LIB_DIR)/libTKXDEIGES.so \
$(OCE_LIB_DIR)/libTKXDESTEP.so \
$(OCE_LIB_DIR)/libTKXMesh.so \
$(OCE_LIB_DIR)/libTKXmlL.so \
$(OCE_LIB_DIR)/libTKXml.so \
$(OCE_LIB_DIR)/libTKXmlTObj.so \
$(OCE_LIB_DIR)/libTKXmlXCAF.so \
$(OCE_LIB_DIR)/libTKXSBase.so



OBJS = step-export-demo.o
CXXFLAGS = -I/usr/local/oce/include/oce -DLIN -DLININTEL -DHAVE_CONFIG_H -DHAVE_IOSTREAM -DHAVE_FSTREAM -DHAVE_LIMITS_H -I. -g
LDFLAGS = -L/usr/local/oce/lib $(OCE_LIBS) $(OCE_LIBS) $(OCE_LIBS) $(OCE_LIBS) -g -lpthread -lX11 -lfreetype -ldl -lGL

all: $(OBJS)
g++ -o step-export-demo $(OBJS) $(LDFLAGS)

clean:
rm -f step-export-demo $(OBJS)

Loading

0 comments on commit 4740ce5

Please sign in to comment.