Skip to content
Snippets Groups Projects
Commit 4a9f83e4 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

better syntax for pipes

parent e019288a
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -4254,19 +4254,19 @@ Extrude : ...@@ -4254,19 +4254,19 @@ Extrude :
&extr, $$); &extr, $$);
List_Delete($3); List_Delete($3);
} }
| tPipe '{' ListOfDouble '}' '{' ListOfShapes '}' | tExtrude '{' ListOfShapes '}' tUsing tLine '{' ListOfDouble '}'
{ {
$$ = List_Create(2, 1, sizeof(Shape)); $$ = List_Create(2, 1, sizeof(Shape));
if(factory == "OpenCASCADE" && GModel::current()->getOCCInternals()){ if(factory == "OpenCASCADE" && GModel::current()->getOCCInternals()){
std::vector<int> edges; std::vector<int> edges;
std::vector<int> in[4], out[4]; std::vector<int> in[4], out[4];
for(int i = 0; i < List_Nbr($3); i++){ for(int i = 0; i < List_Nbr($8); i++){
double d; List_Read($3, i, &d); double d; List_Read($8, i, &d);
edges.push_back((int)d); edges.push_back((int)d);
} }
Shape TheShape; Shape TheShape;
for(int i = 0; i < List_Nbr($6); i++){ for(int i = 0; i < List_Nbr($3); i++){
List_Read($6, i, &TheShape); List_Read($3, i, &TheShape);
int dim = TheShape.Type / 100 - 1; int dim = TheShape.Type / 100 - 1;
if(dim >= 0 && dim <= 3) in[dim].push_back(TheShape.Num); if(dim >= 0 && dim <= 3) in[dim].push_back(TheShape.Num);
} }
...@@ -4285,7 +4285,7 @@ Extrude : ...@@ -4285,7 +4285,7 @@ Extrude :
yymsg(0, "Pipe only available with OpenCASCADE factory"); yymsg(0, "Pipe only available with OpenCASCADE factory");
} }
List_Delete($3); List_Delete($3);
List_Delete($6); List_Delete($8);
} }
// Deprecated extrude commands (for backward compatibility) // Deprecated extrude commands (for backward compatibility)
| tExtrude tPoint '{' FExpr ',' VExpr '}' tEND | tExtrude tPoint '{' FExpr ',' VExpr '}' tEND
......
...@@ -35,5 +35,5 @@ For i In {0:5} ...@@ -35,5 +35,5 @@ For i In {0:5}
EndFor EndFor
BSpline(100) = {100:105}; BSpline(100) = {100:105};
a() = Pipe{100}{ Surface{1:5}; }; a() = Extrude { Surface{1:5}; } Using Line{100};
Delete{ Surface{1:5}; } Delete{ Surface{1:5}; }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment