Skip to content

Commit

Permalink
fixed cmake list
Browse files Browse the repository at this point in the history
  • Loading branch information
kaijohnsonn committed Feb 7, 2024
1 parent 365b451 commit 670b00a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 33 deletions.
4 changes: 2 additions & 2 deletions backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ target_link_libraries(cad_to_gcode ${OpenCASCADE_LIBRARIES})
# Include OpenCASCADE directories
include_directories(${OpenCASCADE_INCLUDE_DIR})

add_executable(todoShape_to_geomCurve src/todoDsShape_to_geomCurve.cpp src/igs_to_todoDsShape.cpp src/ShapeProcessor.hpp)
target_link_libraries(todoShape_to_geomCurve ${OpenCASCADE_LIBRARIES})
add_executable(igs_to_todoDsShape src/igs_to_todoDsShape.cpp)
target_link_libraries(igs_to_todoDsShape ${OpenCASCADE_LIBRARIES})

# Add a new executable for IGES to TopoDS_Shape conversion
# add_executable(iges_to_shape src/igs_to_todoDsShape.cpp)
Expand Down
23 changes: 23 additions & 0 deletions backend/src/igs_to_todoDsShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,29 @@
#include "ShapeProcessor.hpp"
#include <TopoDS_Shape.hxx>


void ProcessShape(const TopoDS_Shape &shape)
{
// Iterate through all edges in the shape
for (TopExp_Explorer explorer(shape, TopAbs_EDGE); explorer.More(); explorer.Next())
{
TopoDS_Edge edge = TopoDS::Edge(explorer.Current());

// Convert TopoDS_Edge to Geom_Curve
BRepAdaptor_Curve curveAdapter(edge);
Handle(Geom_Curve) geomCurve = curveAdapter.Curve().Curve();

// Analyze the curve (e.g., calculate length)
double length = GCPnts_AbscissaPoint::Length(curveAdapter);

// If the curve is a bend, analyze its attributes
// This would involve more specific logic, depending on how bends are defined

// Example output
std::cout << "Curve Length: " << length << std::endl;
}
}

int main(int argc, char *argv[])
{

Expand Down
31 changes: 0 additions & 31 deletions backend/src/todoDsShape_to_geomCurve.cpp

This file was deleted.

0 comments on commit 670b00a

Please sign in to comment.