Skip to content

Commit

Permalink
webgui - fix drawing 3d surface mesh
Browse files Browse the repository at this point in the history
  • Loading branch information
mhochsteger committed Jun 18, 2020
1 parent 2357c79 commit 6a3865f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/webgui/webgui_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def BuildRenderData(mesh, func, order=2, draw_surf=True, draw_vol=True, deformat
d['order2d'] = order2d
d['order3d'] = order3d

d['draw_vol'] = func and mesh.dim==3 and draw_vol
d['draw_vol'] = func and mesh.dim==3 and draw_vol and mesh.ne>0
d['draw_surf'] = func and draw_surf

if isinstance(deformation, bool):
Expand Down Expand Up @@ -349,7 +349,7 @@ def BernsteinTrig(x, y, i, j, n):

timer4.Start()

if mesh.dim==3 and draw_vol:
if d['draw_vol']:
p0 = []
p1 = []
p2 = []
Expand Down Expand Up @@ -392,7 +392,7 @@ def BernsteinTrig(x, y, i, j, n):
[0]*10 )

pts = mesh.MapToAllElements({ngs.ET.TET: ir_tet, ngs.ET.PRISM: ir_prism}, ngs.VOL)
pmat = func1(pts) if draw_vol else func0(pts)
pmat = func1(pts)

ne = mesh.GetNE(ngs.VOL)
pmat = pmat.reshape(-1, len(ir_tet), 4)
Expand All @@ -403,7 +403,7 @@ def BernsteinTrig(x, y, i, j, n):
for i in range(len(ir_tet)):
points3d.append(encodeData(pmat[:,i,:]))

if func2 and draw_vol:
if func2:
pmat = func2(pts).reshape(-1, len(ir_tet)//2, 4)
funcmin = min(funcmin, np.min(pmat))
funcmax = max(funcmax, np.max(pmat))
Expand Down

0 comments on commit 6a3865f

Please sign in to comment.