Repository navigation
Extend plotSolution to visualize arbitrary geometries #41
Description
Activity
- addedenhancementNew feature or requestNew feature or request
on Sep 23, 2025 Hi @nikoscham , I would like to take this issue can you assign this to me for hacktoberfest
Reacted by Nikos ChamakosHi @Pawankalyan2023! Thanks for your interest in contributing to the FEAScript project. Visualizing arbitrary geometries is a core capability that will help drive the project’s future expansion. Feel free to reach out if you need any details or support. Please also consider ⭐️ the project!
Nikos
Reacted by B Pawan KalyanHi @nikoscham ,
I’m interested in working on this issue. If it’s still open and not currently being worked on, could you please assign it to me?Hi @agrim317! Thanks for your interest in contributing to the project. Please also consider ⭐️ the project!
@Pawankalyan2023, just checking — are you still working on this issue? If not, we can reassign it to @agrim317 to keep progress moving.Hi @nikoscham , you can assign to @agrim317
Reacted by Nikos Chamakos@agrim317 you can start working on this issue. Let me know if you need any clarifications!
Reacted by agrim317Hey @agrim317. Just a reminder that Hacktoberfest is wrapping up soon (October 31st). You can always contribute after Hacktoberfest, but you might miss out on their rewards. All the best
- linked a pull request that will close this issueSimplify plotSolution function #57
on Nov 21, 2025 - linked a pull request that will close this issueFeature/arbitrary geometries2 #58
on Nov 21, 2025 @agrim317 I’m currently working on it, as I believe it will be one of the foundation stones for version 0.0.2. We’re adjusting the strategy because I don't think
mesh3dis suitable for 2D cases (at least I wasn't satisfied with it). Below is the updated roadmap for this issue:- Preprocess the finite element mesh. If the element is a quadrilateral, split it into two triangles.
-
Build a spatial index over the triangles. This allows fast queries for triangles near point(x,y). - Create a dense visualization grid. Initialize each grid value to
null. - For each visualization point
(x, y),perform a point-in-triangle test and extract the parent element. - Interpolate the FE solution value using the local coordinates.
Instead of using a spatial index, I have implemented an adjacency-based search to find which element contains a given point. The
plotSolutionfunction (as well as the newplotInterpolatedSolution) will be now called asplotSolution(model, result, plotType, plotDivId)in the HTML examples (see the new example with a rhomboidal geometry here https://feascript.com/tutorials/heat-conduction-2d-rhom-fin-gmsh.html). The new capability is included in the 0.2.0 (first release candidate) version.- added a commit that references this issue
on Dec 18, 2025 - linked a pull request that will close this issueFeature/arbitrary geometries2 #59
on Dec 18, 2025
The
plotSolutionfunction currently supports:xyzarrays) (see e.g the tutorial)However, it does not handle true element-based visualization for arbitrary polygonal topologies.
Tasks:
Introduce a newplotTypeoption, e.g.,"polygon"Use Plotly'sscatterwithfill: 'toself'ormesh3dto draw individual polygonal elements based on element connectivity (e.g., fromnoparrays inmeshGenerationScript.js)For each element, extract node coordinates and solution values to create filled polygons with color mappingExample API usage:
plotSolution(solutionVector, nodesCoordinates, solverConfig, "2D", "polygon", plotDivId);