Skip to content

Instantly share code, notes, and snippets.

View hugoledoux's full-sized avatar

Hugo Ledoux hugoledoux

View GitHub Profile
{
"type": "CityJSONExtension",
"name": "WeixiaoBuilding",
"description": "Extension to model the building parts",
"url": "https://someurl.org/noise.ext.json",
"version": "0.1",
"versionCityJSON": "2.0",
"extraAttributes": {},
"extraCityObjects": {},
"extraRootProperties": {},
@hugoledoux
hugoledoux / fetch.py
Last active October 13, 2023 11:46
3dbag api fetch
import urllib.request
import json
import sys
# myurl = "http://localhost:3200//collections/pand/items/NL.IMBAG.Pand.1655100000500568"
myurl = "http://localhost:3200//collections/pand/items?bbox=75900.011,447000.034,76000.011,447200.034"
# myurl = "http://localhost:3200//collections/pand/items?bbox=75877.011,446130.034,92446.593,460259.369"
try:
@hugoledoux
hugoledoux / torus.city.json
Created May 11, 2023 09:27
a cube with a genus of 1
{
"CityObjects":
{
"id-1":
{
"geometry":
[
{
"type": "Solid",
"lod": "1",
@hugoledoux
hugoledoux / test.txt
Last active April 26, 2023 09:47
testing 1 2 testing
allo les amis
ça va?
oh oh
@hugoledoux
hugoledoux / sqlal2.py
Last active April 27, 2023 09:21
read from cjdb tests
import sys
import json
import copy
import psycopg2
def remove_duplicate_vertices(j):
def update_geom_indices(a, newids):
for i, each in enumerate(a):
if isinstance(each, list):
@hugoledoux
hugoledoux / vis.py
Created December 13, 2022 15:35
polyscope: LAZ + OBJ example
import numpy as np
import polyscope as ps
import laspy
import point_cloud_utils as pcu
with laspy.open('m1-off-ground.laz') as fh:
las = fh.read()
#-- get the coordinates as numpy array nx3
@hugoledoux
hugoledoux / wordle.py
Last active March 24, 2024 10:38
wordle
import json
import sys
from datetime import datetime
import numpy as np
fin = open("/Users/hugo/temp/result.json")
j = json.loads(fin.read())
@hugoledoux
hugoledoux / fix.py
Last active October 26, 2022 15:44
fix collapsed triangles
import sys
import point_cloud_utils as pcu
import numpy as np
def main():
# Load vertices and faces for a mesh
# mv, mf = pcu.load_mesh_vf("./cube2.obj")
mv, mf = pcu.load_mesh_vf("./filled_SM_dataset_4.obj")
@hugoledoux
hugoledoux / geogeek.md
Last active October 19, 2022 07:31
computing literacy topics

Basic of computing

  • filesystem

C++

  • CLion
  • Using WSL
  • CMake help
@hugoledoux
hugoledoux / cjps.py
Created September 27, 2022 14:05
cityjson & polyscope
import polyscope as ps
import json
import sys
import numpy as np
import math
def recusionvisit(a, vs):
for each in a: