Skip to content

Commit a3e51f9

Browse files
committed
skip non-blade components for local coords calculation + verify that it's running
1 parent a07f64e commit a3e51f9

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

frontend/src/components/Results.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ const bladeTipChart = computed(() => {
609609
<ModeViz :ModeData="project.modeViz[project.currentVizID]" :showNodePaths="showNodePaths">
610610
</ModeViz>
611611
</div>
612-
<!-- 2D Sine Wave Chart (20% height) -->
612+
<!-- 2D Blade Tip Deflection Chart (20% height) -->
613613
<div style="width:100%; height: 30vh" class="mt-3">
614614
<Scatter ref="bladeTipChart" :options="bladeTipChart.options" :data="bladeTipChart.data" />
615615
</div>

frontend/wailsjs/go/models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ export namespace viz {
15021502
}
15031503
export class Component {
15041504
Line: Point[];
1505-
LocalLine: Point[];
1505+
LocalLine: Point[];
15061506

15071507
static createFrom(source: any = {}) {
15081508
return new Component(source);
@@ -1511,7 +1511,7 @@ export namespace viz {
15111511
constructor(source: any = {}) {
15121512
if ('string' === typeof source) source = JSON.parse(source);
15131513
this.Line = this.convertValues(source["Line"], Point);
1514-
this.LocalLine = this.convertValues(source["LocalLine"], Point);
1514+
this.LocalLine = this.convertValues(source["LocalLine"], Point);
15151515
}
15161516

15171517
convertValues(a: any, classs: any, asMap: boolean = false): any {

viz/viz.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ func (opts *Options) GenerateModeData(execPath string, op *lin.LinOP, modeIDs []
204204

205205
// Parse mode data from files
206206
md, err := ParseModeData(vtpFilePaths)
207-
fmt.Println("Mode Data:", md)
208207

209208
if err != nil {
210209
return nil, err
@@ -301,15 +300,13 @@ func ParseModeData(vtpFilePaths []string) (*ModeData, error) {
301300
copy(component.Line[j].XYZ[:], vtk.PolyData.Piece.Points.DataArray.MatrixF32[c])
302301
}
303302

304-
fmt.Println(vtk.PolyData.Piece.Points.DataArray.MatrixF32)
305-
306-
// Add local coordinates
307-
component.LocalLine = make([]Point, len(conn))
308-
for j, c := range conn {
309-
copy(component.LocalLine[j].XYZ[:], local_vtk.PolyData.Piece.Points.DataArray.MatrixF32[c])
303+
// Copy local line data into component
304+
if local_vtk != nil {
305+
component.LocalLine = make([]Point, len(conn))
306+
for j, c := range conn {
307+
copy(component.LocalLine[j].XYZ[:], local_vtk.PolyData.Piece.Points.DataArray.MatrixF32[c])
308+
}
310309
}
311-
312-
fmt.Println(local_vtk.PolyData.Piece.Points.DataArray.MatrixF32)
313310
}
314311

315312
return &mv, nil

viz/vtk.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/xml"
66
"fmt"
77
"os"
8+
"path/filepath"
89
"strconv"
910
"strings"
1011
)
@@ -133,12 +134,15 @@ func LoadVTK(path string) (*VTKFile, *VTKFile, error) {
133134
return nil, nil, err
134135
}
135136

137+
// Skip for non-blade files for local coords conversion
138+
if !strings.Contains(filepath.Base(path), "Blade") {
139+
return vf, nil, nil
140+
}
141+
136142
local_vf, err := Global2Local(vf)
137143
if err != nil {
138144
return nil, nil, fmt.Errorf("Failed to convert global coordinates to local: %w", err)
139145
}
140-
fmt.Println(vf.PolyData.Piece.Points.DataArray.MatrixF32)
141-
fmt.Println(local_vf.PolyData.Piece.Points.DataArray.MatrixF32)
142146

143147
return vf, local_vf, nil
144148
}

0 commit comments

Comments
 (0)