Skip to content

Commit

Permalink
mesh boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
JerryI committed Jul 10, 2024
1 parent 767cfb6 commit 11d1ff7
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/BoxesWorkarounds.wl
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,36 @@ Pane /: EventHandler[p_Pane, list_List] := With[{
]


Unprotect[BoundaryMeshRegion]
BoundaryMeshRegion /: MakeBoxes[b_BoundaryMeshRegion, StandardForm] := With[{r = If[RegionDimension[b] == 3, RegionPlot3D[b, ImageSize->200], Insert[RegionPlot[b, ImageSize->200, Axes->False, Frame->False, ImagePadding->10], JerryI`Notebook`Graphics2D`Controls->False, {2,-1}]] // CreateFrontEndObject},
If[ByteCount[b] > 5250,
LeakyModule[{temporal},
With[{v = ViewBox[temporal, r]},
AppendTo[Kernel`Internal`garbage, Hold[temporal]];
temporal = b;
v
]
]

,
ViewBox[b, r]
]

]

Unprotect[MeshRegion]
MeshRegion /: MakeBoxes[b_MeshRegion, StandardForm] := With[{r = If[RegionDimension[b] == 3, RegionPlot3D[b, ImageSize->200], Insert[RegionPlot[b, ImageSize->200, Axes->False, Frame->False, ImagePadding->10], JerryI`Notebook`Graphics2D`Controls->False, {2,-1}]] // CreateFrontEndObject},
If[ByteCount[b] > 5250,
LeakyModule[{temporal},
With[{v = ViewBox[temporal, r]},
AppendTo[Kernel`Internal`garbage, Hold[temporal]];
temporal = b;
v
]
]

,
ViewBox[b, r]
]
]

0 comments on commit 11d1ff7

Please sign in to comment.