iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.1k stars 298 forks source link

[chore/Feature2Mesh] factorize featureTo family of function #2217

Open Desplandis opened 11 months ago

Desplandis commented 11 months ago

Description

Follow-up of #2180. Refactoring Feature2Mesh to reduce duplication of code.

Motivation and Context

There is lot of duplicated code in the featureTo* family of functions:

This leads to potential bugs, out-of-sync code (e.g. between featureToPolygon* functions) and does not ease maintenance of this module.

This PR aims to generalize code of both functions (e.g. at least featureToPoint/featureToLine & featureToPolygon/featureToExtrudedPolygons).