Closed AdrianKriger closed 3 years ago
Hi Adrian. Glad to see you are interested in CityJSON.
I think your issue is in add_terrain_v
, where there seems to be one extra square bracket wrapped around the vertex coordinates. The right code should be:
def add_terrain_v(pts, cm):
for p in pts:
cm['vertices'].append([p[0], p[1], p[2]]) # <- There was an extra square bracket here
Haven't checked thoroughly the rest of the code, but this for sure is an issue.
PS: It's very nice to see that you have some nice metadata in your model! 👏
I am sorry to bother you with this trivial matter but I need your help.
I would like to create a basic LoD1 cityjson terrain model but am unable too. Vertices and geometry boundaries (indices / simplices) are via a Constrained Delaunay with python bindings of Shewchuck's; Triangle [option 'p' with holes - concavities removed].
Wavefront.obj is successfully created but I fail with cityjson. The code is:
where
T
andpts
are the simplices and points respectively. The complete workflow is here. Your guidance is appreciated.