Skip to content

Commit

Permalink
✨ feat: add Shape API
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangechen committed Sep 23, 2024
1 parent ff12757 commit 69f6f36
Show file tree
Hide file tree
Showing 19 changed files with 1,843 additions and 512 deletions.
18 changes: 18 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"configurations": [
{
"name": "Mac",
"includePath": ["${workspaceFolder}/**"],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-arm64",
"configurationProvider": "${default}"
}
],
"version": 4
}
304 changes: 24 additions & 280 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,290 +7,32 @@ set (TARGET chili-wasm)
get_filename_component(SOURCE_ROOT_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)
set(CMAKE_INSTALL_PREFIX "${SOURCE_ROOT_DIR}/packages/chili-wasm/lib")

set (OcctModules
#FoundationClasses
TKernel TKMath
# ModelingData
TKG2d TKG3d TKGeomBase TKBRep
#ModelingAlgorithms
TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKShHealing
#Visualization
TKService TKV3d
#ApplicationFramework
TKCDF TKLCAF TKCAF TKStdL TKStd TKVCAF TKBin TKBinL TKBinXCAF
#DataExchange
TKDE TKXSBase TKDESTEP TKDEIGES TKDESTL TKDEVRML TKDEOBJ TKDEGLTF TKDEPLY TKXCAF TKRWMesh
)

set (OcctSourceFolders)
set (OcctIncludeDirs)
set (OcctModules
Adaptor2d
Adaptor3d
AdvApp2Var
AdvApprox
AIS
APIHeaderSection
AppBlend
AppCont
AppDef
AppParCurves
Approx
ApproxInt
Aspect
BinDrivers
BinLDrivers
BinMDataStd
BinMDataXtd
BinMDF
BinMDocStd
BinMDocXtd
BinMNaming
BinMFunction
BinMXCAFDoc
BinObjMgt
BinTools
BinXCAFDrivers
Bisector
Bnd
BndLib
BOPAlgo
BOPDS
BOPTools
BRep
BRepAdaptor
BRepAlgo
BRepAlgoAPI
BRepApprox
BRepBndLib
BRepBuilderAPI
BRepCheck
BRepClass
BRepClass3d
BRepExtrema
BRepFill
BRepGProp
BRepIntCurveSurface
BRepLib
BRepLProp
BRepMAT2d
BRepMesh
BRepMeshData
BRepPrim
BRepPrimAPI
BRepSweep
BRepToIGES
BRepToIGESBRep
BRepTools
BRepTopAdaptor
BSplCLib
BSplSLib
BVH
CDF
CDM
Contap
Convert
CPnts
CSLib
DE
DsgPrs
ElCLib
ElSLib
Extrema
FEmTool
FlexLexer
Font
FSD
GC
GccAna
GccEnt
GccInt
gce
GCE2d
GCPnts
Geom
Geom2d
Geom2dAdaptor
Geom2dAPI
Geom2dConvert
Geom2dEvaluator
Geom2dGcc
Geom2dHatch
Geom2dInt
Geom2dLProp
Geom2dToIGES
GeomAbs
GeomAdaptor
GeomAPI
GeomConvert
GeomEvaluator
GeomFill
GeomInt
GeomLib
GeomLProp
GeomPlate
GeomProjLib
GeomToIGES
GeomTools
GeomToStep
gp
GProp
Graphic3d
Hatch
HatchGen
HeaderSection
Hermit
HLRAlgo
HLRBRep
HLRTopoBRep
IFGraph
IFSelect
IGESAppli
IGESBasic
IGESCAFControl
IGESControl
IGESConvGeom
IGESData
IGESDefs
IGESDimen
IGESDraw
IGESFile
IGESGeom
IGESGraph
IGESSelect
IGESSolid
IGESToBRep
Image
IMeshData
IMeshTools
IntAna
IntAna2d
IntCurve
IntCurvesFace
IntCurveSurface
Interface
Intf
IntImp
IntImpParGen
IntPatch
IntPolyh
IntRes2d
Intrv
IntStart
IntSurf
IntTools
IntWalk
Law
LDOM
LDOMParser
LibCtl
LocalAnalysis
LProp
LProp3d
MAT
MAT2d
math
Media
Message
MoniTool
NCollection
OSD
PCDM
Plate
PLib
Plugin
Poly
Precision
ProjLib
Prs3d
PrsDim
PrsMgr
Quantity
Resource
RWHeaderSection
RWStepAP203
RWStepAP214
RWStepAP242
RWStepBasic
RWStepDimTol
RWStepElement
RWStepFEA
RWStepGeom
RWStepKinematics
RWStepRepr
RWStepShape
RWStepVisual
Select3D
SelectBasics
SelectMgr
ShapeAlgo
ShapeAnalysis
ShapeBuild
ShapeConstruct
ShapeCustom
ShapeExtend
ShapeFix
ShapeProcess
ShapeUpgrade
Standard
StdFail
StdPrs
StdSelect
StepAP203
StepAP214
StepAP242
StepBasic
STEPCAFControl
STEPConstruct
STEPControl
StepData
StepDimTol
STEPEdit
StepElement
StepFEA
StepFile
StepGeom
StepKinematics
StepRepr
StepSelect
STEPSelections
StepShape
StepToGeom
StepToTopoDS
StepVisual
Storage
Sweep
TColGeom
TColGeom2d
TColgp
TCollection
TColStd
TDataStd
TDataXtd
TDF
TDocStd
TFunction
TNaming
TopAbs
TopBas
TopClass
TopCnx
TopExp
TopLoc
TopoDS
TopoDSToStep
TopOpeBRepBuild
TopOpeBRepDS
TopOpeBRepTool
TopTools
TopTrans
TPrsStd
Transfer
TransferBRep
TShort
Units
UnitsAPI
UnitsMethods
UTL
V3d
WNT
XCAFDimTolObjects
XCAFDoc
XCAFNoteObjects
XCAFPrs
XCAFView
XSAlgo
XSControl
)

foreach(module ${OcctModules})
list (APPEND OcctSourceFolders build/occt/src/${module}/*.c*)
list (APPEND OcctIncludeDirs build/occt/src/${module})
file (STRINGS build/occt/src/${module}/PACKAGES OcctPackage)
foreach(package ${OcctPackage})
if (NOT package STREQUAL "")
list (APPEND OcctSourceFolders build/occt/src/${package}/*.c*)
list (APPEND OcctIncludeDirs build/occt/src/${package})
endif()
endforeach()
endforeach()

file (GLOB OcctSourceFiles ${OcctSourceFolders})
Expand All @@ -310,9 +52,11 @@ if (${EMSCRIPTEN})
target_compile_options (${TARGET} PUBLIC -O3)
target_compile_options (${TARGET} PUBLIC -flto)
target_compile_options (${TARGET} PUBLIC -DOCCT_NO_PLUGINS)
target_compile_options (${TARGET} PUBLIC -sDISABLE_EXCEPTION_CATCHING=1)

target_link_options (${TARGET} PUBLIC -flto)
target_link_options (${TARGET} PUBLIC -O3)
target_link_options (${TARGET} PUBLIC -sDISABLE_EXCEPTION_CATCHING=1)
target_link_options (${TARGET} PUBLIC -sMODULARIZE=1)
target_link_options (${TARGET} PUBLIC -sEXPORT_ES6=1)
target_link_options (${TARGET} PUBLIC -sEXPORT_NAME='ChiliWasm')
Expand Down
13 changes: 13 additions & 0 deletions cpp/src/geometry.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <Geom_Curve.hxx>
#include <Standard_Handle.hxx>
#include <gp_Dir.hxx>

class Geometry {
public:

};

class Curve {
public:

};
Loading

0 comments on commit 69f6f36

Please sign in to comment.