xeltofab 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xeltofab-0.2.2/.claude/settings.local.json +18 -0
- xeltofab-0.2.2/.github/workflows/deploy-website.yml +31 -0
- xeltofab-0.2.2/.gitignore +218 -0
- xeltofab-0.2.2/.python-version +1 -0
- xeltofab-0.2.2/AGENTS.md +3 -0
- xeltofab-0.2.2/CLAUDE.md +94 -0
- xeltofab-0.2.2/LICENSE +21 -0
- xeltofab-0.2.2/PKG-INFO +164 -0
- xeltofab-0.2.2/README.md +114 -0
- xeltofab-0.2.2/benchmarks/after_remesh/beam_2d_100x200_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/corner_3d_vf30_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/corner_3d_vf30_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/corner_3d_vf30_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/corner_3d_vf50_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/corner_3d_vf50_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/corner_3d_vf50_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/heat_cond_51_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/heat_cond_51_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/heat_cond_51_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/heat_cond_51_s1.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/heat_cond_51_s1_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/heat_cond_51_s1_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/metrics.json +246 -0
- xeltofab-0.2.2/benchmarks/after_remesh/summary.md +21 -0
- xeltofab-0.2.2/benchmarks/after_remesh/synthetic_sphere.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/synthetic_sphere_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/synthetic_sphere_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/synthetic_sphere_sdf.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/synthetic_sphere_sdf_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/synthetic_sphere_sdf_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/thermoelastic_16_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/thermoelastic_16_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_remesh/thermoelastic_16_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/beam_2d_100x200_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/corner_3d_vf30_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/corner_3d_vf30_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/corner_3d_vf30_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/corner_3d_vf50_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/corner_3d_vf50_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/corner_3d_vf50_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/heat_cond_51_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/heat_cond_51_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/heat_cond_51_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/heat_cond_51_s1.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/heat_cond_51_s1_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/heat_cond_51_s1_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/metrics.json +246 -0
- xeltofab-0.2.2/benchmarks/after_tier2/summary.md +21 -0
- xeltofab-0.2.2/benchmarks/after_tier2/synthetic_sphere.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/synthetic_sphere_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/synthetic_sphere_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/synthetic_sphere_sdf.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/synthetic_sphere_sdf_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/synthetic_sphere_sdf_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/thermoelastic_16_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/thermoelastic_16_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/after_tier2/thermoelastic_16_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/beam_2d_100x200_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/corner_3d_vf30_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/corner_3d_vf30_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/corner_3d_vf30_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/corner_3d_vf50_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/corner_3d_vf50_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/corner_3d_vf50_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/heat_cond_51_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/heat_cond_51_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/heat_cond_51_s0_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/heat_cond_51_s1.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/heat_cond_51_s1_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/heat_cond_51_s1_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/metrics.json +246 -0
- xeltofab-0.2.2/benchmarks/baseline/summary.md +21 -0
- xeltofab-0.2.2/benchmarks/baseline/synthetic_sphere.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/synthetic_sphere_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/synthetic_sphere_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/synthetic_sphere_sdf.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/synthetic_sphere_sdf_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/synthetic_sphere_sdf_mesh.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/thermoelastic_16_s0.stl +0 -0
- xeltofab-0.2.2/benchmarks/baseline/thermoelastic_16_s0_comparison.png +0 -0
- xeltofab-0.2.2/benchmarks/baseline/thermoelastic_16_s0_mesh.png +0 -0
- xeltofab-0.2.2/data/examples/README.md +54 -0
- xeltofab-0.2.2/data/examples/beams_2d_100x200_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_100x200_sample1.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_100x200_sample2.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_25x50_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_25x50_sample1.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_25x50_sample2.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_50x100_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_50x100_sample1.npy +0 -0
- xeltofab-0.2.2/data/examples/beams_2d_50x100_sample2.npy +0 -0
- xeltofab-0.2.2/data/examples/corner_3d_20x20x20_vf30_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/corner_3d_20x20x20_vf50_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/heat_conduction_3d_51x51x51_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/heat_conduction_3d_51x51x51_sample1.npy +0 -0
- xeltofab-0.2.2/data/examples/thermoelastic_3d_16x16x16_sample0.npy +0 -0
- xeltofab-0.2.2/data/examples/thermoelastic_3d_16x16x16_sample1.npy +0 -0
- xeltofab-0.2.2/docs/ARCHITECTURE.md +227 -0
- xeltofab-0.2.2/docs/PROGRESS.md +255 -0
- xeltofab-0.2.2/docs/TODO.md +70 -0
- xeltofab-0.2.2/docs/TO_fixtures_integration_analysis.md +90 -0
- xeltofab-0.2.2/docs/generate_slides.py +370 -0
- xeltofab-0.2.2/notebooks/.claude/settings.local.json +15 -0
- xeltofab-0.2.2/notebooks/README.md +32 -0
- xeltofab-0.2.2/notebooks/demo.py +351 -0
- xeltofab-0.2.2/notebooks/demo_formats.py +579 -0
- xeltofab-0.2.2/pyproject.toml +67 -0
- xeltofab-0.2.2/scripts/benchmark_baseline.py +283 -0
- xeltofab-0.2.2/scripts/generate_bunny_sdf.py +53 -0
- xeltofab-0.2.2/scripts/generate_doc_images.py +1016 -0
- xeltofab-0.2.2/src/xeltofab/__init__.py +17 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/__init__.py +1 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/dual_isosurface/LICENSE +21 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/dual_isosurface/__init__.py +10 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/dual_isosurface/core.py +139 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/dual_isosurface/grid.py +152 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/dual_isosurface/mesh_utils.py +21 -0
- xeltofab-0.2.2/src/xeltofab/_vendor/dual_isosurface/strategies.py +191 -0
- xeltofab-0.2.2/src/xeltofab/cli.py +203 -0
- xeltofab-0.2.2/src/xeltofab/decimate.py +63 -0
- xeltofab-0.2.2/src/xeltofab/extract.py +200 -0
- xeltofab-0.2.2/src/xeltofab/field_plots.py +110 -0
- xeltofab-0.2.2/src/xeltofab/io.py +44 -0
- xeltofab-0.2.2/src/xeltofab/loaders/__init__.py +93 -0
- xeltofab-0.2.2/src/xeltofab/loaders/csv_loader.py +43 -0
- xeltofab-0.2.2/src/xeltofab/loaders/hdf5_loader.py +110 -0
- xeltofab-0.2.2/src/xeltofab/loaders/matlab_loader.py +44 -0
- xeltofab-0.2.2/src/xeltofab/loaders/numpy_loader.py +21 -0
- xeltofab-0.2.2/src/xeltofab/loaders/vtk_loader.py +69 -0
- xeltofab-0.2.2/src/xeltofab/pipeline.py +85 -0
- xeltofab-0.2.2/src/xeltofab/preprocess.py +47 -0
- xeltofab-0.2.2/src/xeltofab/quality.py +65 -0
- xeltofab-0.2.2/src/xeltofab/quality_plots.py +254 -0
- xeltofab-0.2.2/src/xeltofab/remesh.py +60 -0
- xeltofab-0.2.2/src/xeltofab/repair.py +54 -0
- xeltofab-0.2.2/src/xeltofab/sdf_eval.py +400 -0
- xeltofab-0.2.2/src/xeltofab/smooth.py +131 -0
- xeltofab-0.2.2/src/xeltofab/state.py +118 -0
- xeltofab-0.2.2/tests/conftest.py +78 -0
- xeltofab-0.2.2/tests/test_cli.py +102 -0
- xeltofab-0.2.2/tests/test_decimate.py +62 -0
- xeltofab-0.2.2/tests/test_extract.py +81 -0
- xeltofab-0.2.2/tests/test_extract_dc.py +286 -0
- xeltofab-0.2.2/tests/test_field_plots.py +58 -0
- xeltofab-0.2.2/tests/test_io.py +52 -0
- xeltofab-0.2.2/tests/test_loaders/__init__.py +0 -0
- xeltofab-0.2.2/tests/test_loaders/test_cli_formats.py +77 -0
- xeltofab-0.2.2/tests/test_loaders/test_csv_loader.py +57 -0
- xeltofab-0.2.2/tests/test_loaders/test_dispatch.py +47 -0
- xeltofab-0.2.2/tests/test_loaders/test_hdf5_loader.py +157 -0
- xeltofab-0.2.2/tests/test_loaders/test_matlab_loader.py +71 -0
- xeltofab-0.2.2/tests/test_loaders/test_numpy_loader.py +72 -0
- xeltofab-0.2.2/tests/test_loaders/test_vtk_loader.py +115 -0
- xeltofab-0.2.2/tests/test_pipeline.py +64 -0
- xeltofab-0.2.2/tests/test_preprocess.py +59 -0
- xeltofab-0.2.2/tests/test_quality.py +46 -0
- xeltofab-0.2.2/tests/test_quality_plots.py +119 -0
- xeltofab-0.2.2/tests/test_remesh.py +75 -0
- xeltofab-0.2.2/tests/test_repair.py +35 -0
- xeltofab-0.2.2/tests/test_sdf_eval.py +361 -0
- xeltofab-0.2.2/tests/test_smooth.py +126 -0
- xeltofab-0.2.2/tests/test_state.py +154 -0
- xeltofab-0.2.2/uv.lock +1477 -0
- xeltofab-0.2.2/website/.gitignore +26 -0
- xeltofab-0.2.2/website/README.md +45 -0
- xeltofab-0.2.2/website/app/(home)/layout.tsx +6 -0
- xeltofab-0.2.2/website/app/(home)/page.tsx +243 -0
- xeltofab-0.2.2/website/app/api/search/route.ts +7 -0
- xeltofab-0.2.2/website/app/docs/[[...slug]]/page.tsx +52 -0
- xeltofab-0.2.2/website/app/docs/layout.tsx +11 -0
- xeltofab-0.2.2/website/app/global.css +42 -0
- xeltofab-0.2.2/website/app/layout.tsx +39 -0
- xeltofab-0.2.2/website/app/llms-full.txt/route.ts +10 -0
- xeltofab-0.2.2/website/app/llms.mdx/docs/[[...slug]]/route.ts +20 -0
- xeltofab-0.2.2/website/app/llms.txt/route.ts +8 -0
- xeltofab-0.2.2/website/app/og/docs/[...slug]/route.tsx +27 -0
- xeltofab-0.2.2/website/bun.lock +918 -0
- xeltofab-0.2.2/website/components/ImageCompare.tsx +146 -0
- xeltofab-0.2.2/website/components/MeshViewer.tsx +102 -0
- xeltofab-0.2.2/website/content/docs/api/load-field.mdx +97 -0
- xeltofab-0.2.2/website/content/docs/api/meta.json +4 -0
- xeltofab-0.2.2/website/content/docs/api/pipeline-params.mdx +129 -0
- xeltofab-0.2.2/website/content/docs/api/pipeline-state.mdx +88 -0
- xeltofab-0.2.2/website/content/docs/api/process-from-sdf.mdx +195 -0
- xeltofab-0.2.2/website/content/docs/api/process.mdx +81 -0
- xeltofab-0.2.2/website/content/docs/api/save-mesh.mdx +68 -0
- xeltofab-0.2.2/website/content/docs/api/visualization.mdx +85 -0
- xeltofab-0.2.2/website/content/docs/cli/formats.mdx +42 -0
- xeltofab-0.2.2/website/content/docs/cli/meta.json +4 -0
- xeltofab-0.2.2/website/content/docs/cli/process.mdx +132 -0
- xeltofab-0.2.2/website/content/docs/cli/viz.mdx +62 -0
- xeltofab-0.2.2/website/content/docs/getting-started/installation.mdx +79 -0
- xeltofab-0.2.2/website/content/docs/getting-started/meta.json +5 -0
- xeltofab-0.2.2/website/content/docs/getting-started/quick-start.mdx +195 -0
- xeltofab-0.2.2/website/content/docs/guides/extraction-methods.mdx +166 -0
- xeltofab-0.2.2/website/content/docs/guides/field-types.mdx +109 -0
- xeltofab-0.2.2/website/content/docs/guides/input-formats.mdx +168 -0
- xeltofab-0.2.2/website/content/docs/guides/meta.json +5 -0
- xeltofab-0.2.2/website/content/docs/guides/parameters.mdx +153 -0
- xeltofab-0.2.2/website/content/docs/guides/pipeline-overview.mdx +195 -0
- xeltofab-0.2.2/website/content/docs/guides/quality-metrics.mdx +103 -0
- xeltofab-0.2.2/website/content/docs/guides/sdf-functions.mdx +188 -0
- xeltofab-0.2.2/website/content/docs/index.mdx +61 -0
- xeltofab-0.2.2/website/content/docs/meta.json +10 -0
- xeltofab-0.2.2/website/lib/layout.shared.ts +21 -0
- xeltofab-0.2.2/website/lib/source.ts +21 -0
- xeltofab-0.2.2/website/mdx-components.tsx +11 -0
- xeltofab-0.2.2/website/next-env.d.ts +6 -0
- xeltofab-0.2.2/website/next.config.mjs +18 -0
- xeltofab-0.2.2/website/package.json +36 -0
- xeltofab-0.2.2/website/postcss.config.mjs +7 -0
- xeltofab-0.2.2/website/public/images/getting-started/quick-start-2d.png +0 -0
- xeltofab-0.2.2/website/public/images/getting-started/quick-start-smoothing.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/extraction-comparison.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/extraction-gradient-quality.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/field-types-comparison.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/param-sigma.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/param-taubin.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/param-threshold.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/pipeline-flow.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/pipeline-stages.png +0 -0
- xeltofab-0.2.2/website/public/images/guides/quality-jacobian.png +0 -0
- xeltofab-0.2.2/website/public/images/home/hero-after.png +0 -0
- xeltofab-0.2.2/website/public/images/home/hero-before.png +0 -0
- xeltofab-0.2.2/website/public/images/home/hero-field.png +0 -0
- xeltofab-0.2.2/website/public/models/bunny_dc.stl +0 -0
- xeltofab-0.2.2/website/public/models/bunny_mc.stl +0 -0
- xeltofab-0.2.2/website/public/models/cube_dc.stl +0 -0
- xeltofab-0.2.2/website/public/models/cube_mc.stl +0 -0
- xeltofab-0.2.2/website/public/models/heat_cond_51_s0.stl +0 -0
- xeltofab-0.2.2/website/public/models/synthetic_sphere.stl +0 -0
- xeltofab-0.2.2/website/source.config.ts +26 -0
- xeltofab-0.2.2/website/tsconfig.json +36 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"mcp__plugin_claude-mem_mcp-search__search",
|
|
5
|
+
"Bash(du:*)",
|
|
6
|
+
"Bash(sqlite3:*)",
|
|
7
|
+
"Bash(rm:*)",
|
|
8
|
+
"Bash(kill 7397:*)",
|
|
9
|
+
"mcp__plugin_claude-mem_mcp-search__smart_outline",
|
|
10
|
+
"Bash(ls:*)",
|
|
11
|
+
"Bash(wc:*)",
|
|
12
|
+
"Bash(grep -c \"^def test_\" /home/xarthurx/repo/xelToFab/tests/*.py /home/xarthurx/repo/xelToFab/tests/test_loaders/*.py)",
|
|
13
|
+
"Bash(uv run:*)",
|
|
14
|
+
"Bash(grep:*)",
|
|
15
|
+
"Bash(git:*)"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Deploy Website to Vercel
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- 'website/**'
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
11
|
+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
deploy:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- uses: oven-sh/setup-bun@v2
|
|
20
|
+
|
|
21
|
+
- name: Install Vercel CLI
|
|
22
|
+
run: bun add -g vercel
|
|
23
|
+
|
|
24
|
+
- name: Pull Vercel project settings
|
|
25
|
+
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
|
26
|
+
|
|
27
|
+
- name: Build
|
|
28
|
+
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
29
|
+
|
|
30
|
+
- name: Deploy to Vercel
|
|
31
|
+
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
!website/lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py.cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
#Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# UV
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
#uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
#poetry.lock
|
|
110
|
+
#poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
#pdm.lock
|
|
117
|
+
#pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
#pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi
|
|
127
|
+
|
|
128
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
129
|
+
__pypackages__/
|
|
130
|
+
|
|
131
|
+
# Celery stuff
|
|
132
|
+
celerybeat-schedule
|
|
133
|
+
celerybeat.pid
|
|
134
|
+
|
|
135
|
+
# SageMath parsed files
|
|
136
|
+
*.sage.py
|
|
137
|
+
|
|
138
|
+
# Environments
|
|
139
|
+
.env
|
|
140
|
+
.envrc
|
|
141
|
+
.venv
|
|
142
|
+
env/
|
|
143
|
+
venv/
|
|
144
|
+
ENV/
|
|
145
|
+
env.bak/
|
|
146
|
+
venv.bak/
|
|
147
|
+
|
|
148
|
+
# Spyder project settings
|
|
149
|
+
.spyderproject
|
|
150
|
+
.spyproject
|
|
151
|
+
|
|
152
|
+
# Rope project settings
|
|
153
|
+
.ropeproject
|
|
154
|
+
|
|
155
|
+
# mkdocs documentation
|
|
156
|
+
/site
|
|
157
|
+
|
|
158
|
+
# mypy
|
|
159
|
+
.mypy_cache/
|
|
160
|
+
.dmypy.json
|
|
161
|
+
dmypy.json
|
|
162
|
+
|
|
163
|
+
# Pyre type checker
|
|
164
|
+
.pyre/
|
|
165
|
+
|
|
166
|
+
# pytype static type analyzer
|
|
167
|
+
.pytype/
|
|
168
|
+
|
|
169
|
+
# Cython debug symbols
|
|
170
|
+
cython_debug/
|
|
171
|
+
|
|
172
|
+
# PyCharm
|
|
173
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
174
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
175
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
176
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
177
|
+
#.idea/
|
|
178
|
+
|
|
179
|
+
# Abstra
|
|
180
|
+
# Abstra is an AI-powered process automation framework.
|
|
181
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
182
|
+
# Learn more at https://abstra.io/docs
|
|
183
|
+
.abstra/
|
|
184
|
+
|
|
185
|
+
# Visual Studio Code
|
|
186
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
187
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
188
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
189
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
190
|
+
# .vscode/
|
|
191
|
+
|
|
192
|
+
# Ruff stuff:
|
|
193
|
+
.ruff_cache/
|
|
194
|
+
|
|
195
|
+
# PyPI configuration file
|
|
196
|
+
.pypirc
|
|
197
|
+
|
|
198
|
+
# Cursor
|
|
199
|
+
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
|
|
200
|
+
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
|
|
201
|
+
# refer to https://docs.cursor.com/context/ignore-files
|
|
202
|
+
.cursorignore
|
|
203
|
+
.cursorindexingignore
|
|
204
|
+
|
|
205
|
+
# Marimo
|
|
206
|
+
marimo/_static/
|
|
207
|
+
marimo/_lsp/
|
|
208
|
+
__marimo__/
|
|
209
|
+
|
|
210
|
+
# Worktrees
|
|
211
|
+
.worktrees/
|
|
212
|
+
|
|
213
|
+
# Docs website
|
|
214
|
+
website/.next/
|
|
215
|
+
website/node_modules/
|
|
216
|
+
website/.source/
|
|
217
|
+
.vercel
|
|
218
|
+
.env*.local
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
xeltofab-0.2.2/AGENTS.md
ADDED
xeltofab-0.2.2/CLAUDE.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
**XelToFab** — Design field post-processing pipeline: scalar fields → meshes → fabrication-ready geometry. Python 3.13+, `uv` project management. Package: `xeltofab` (`src/xeltofab/`).
|
|
6
|
+
|
|
7
|
+
Research notes: `~/winHome/repo/xKnowledgeSync/99_academic.work/MAX_Mark/proj_XelToFab/`
|
|
8
|
+
Background material: `~/winHome/repo/xKnowledgeSync/99_academic.work/MAX_Mark/` (brainstorms, strategy, glossary)
|
|
9
|
+
Key reference: [`{Review} The Topology Optimization Post-Processing Pipeline.md`](file:///home/xarthurx/winHome/repo/xKnowledgeSync/99_academic.work/MAX_Mark/proj_XelToFab/%7BReview%7D%20The%20Topology%20Optimization%20Post-Processing%20Pipeline.md) — full literature review covering all 4 pipeline stages, toolchain, and feasibility analysis.
|
|
10
|
+
Collaboration: M4X–IDEAL Lab with Prof. Mark Fuge.
|
|
11
|
+
|
|
12
|
+
## Pipeline Architecture
|
|
13
|
+
|
|
14
|
+
1. **Preprocessing** — Threshold (Heaviside), smooth (Gaussian), clean (morphology + connected components)
|
|
15
|
+
2. **Mesh Extraction** — Marching cubes/squares (scikit-image); differentiable via FlexiCubes/Kaolin
|
|
16
|
+
3. **Mesh Post-processing** — Taubin smoothing, QEM decimation, isotropic remeshing, repair
|
|
17
|
+
4. **Mesh-to-CAD** — Patch decomposition, NURBS fitting, B-Rep assembly (research frontier)
|
|
18
|
+
|
|
19
|
+
## Project-Specific Commands
|
|
20
|
+
|
|
21
|
+
| Task | Command |
|
|
22
|
+
|------|---------|
|
|
23
|
+
| Install dependencies | `uv sync` |
|
|
24
|
+
| Run tests | `uv run pytest tests/ -v` |
|
|
25
|
+
| Lint | `ruff check` |
|
|
26
|
+
| Format | `ruff format` |
|
|
27
|
+
| Type check | `ty check` |
|
|
28
|
+
| CLI help | `uv run xtf --help` |
|
|
29
|
+
| Dev docs site | `cd website && bun run dev` |
|
|
30
|
+
| Build docs site | `cd website && bun run build` |
|
|
31
|
+
|
|
32
|
+
## Core Dependencies
|
|
33
|
+
|
|
34
|
+
| Stage | Libraries |
|
|
35
|
+
|-------|-----------|
|
|
36
|
+
| Preprocessing | `scipy.ndimage`, `scikit-image` |
|
|
37
|
+
| Mesh extraction | `scikit-image` (marching cubes), `pyvista`/VTK |
|
|
38
|
+
| Smoothing / decimation | `pyvista`, `pymeshlab`, `open3d` |
|
|
39
|
+
| Mesh I/O / repair | `trimesh` |
|
|
40
|
+
| Quality metrics | `pyvista` (`mesh.quality()`) |
|
|
41
|
+
| NURBS / CAD export | `pythonocc-core`, `cadquery` |
|
|
42
|
+
| Format conversion | `meshio` |
|
|
43
|
+
| I/O formats | `scipy.io` (.mat), `pyvista` (.vtk), `h5py` (.h5/.xdmf) |
|
|
44
|
+
|
|
45
|
+
## Conventions
|
|
46
|
+
|
|
47
|
+
- Input: numpy arrays — density fields in [0, 1] or SDF fields (unbounded)
|
|
48
|
+
- Mesh quality targets (FEA): aspect ratio < 5, min angle > 20°, scaled Jacobian > 0.5
|
|
49
|
+
- Always validate volume preservation after smoothing
|
|
50
|
+
- Re-verify connectivity after decimation (thin TO features can collapse)
|
|
51
|
+
- B-spline fitting: keep < 100 points per parametric direction to avoid oscillation
|
|
52
|
+
|
|
53
|
+
## Documentation Layout
|
|
54
|
+
|
|
55
|
+
| File | Location | Purpose |
|
|
56
|
+
|------|----------|---------|
|
|
57
|
+
| `CLAUDE.md` | repo root | Agent instructions (this file) |
|
|
58
|
+
| `README.md` | repo root | Project overview, quick start, API examples |
|
|
59
|
+
| `ARCHITECTURE.md` | `docs/` | Module map, data flow, dependency table |
|
|
60
|
+
| `TODO.md` | `docs/` | Feature backlog (tiered) |
|
|
61
|
+
| `PROGRESS.md` | `docs/` | Incident log & project memory |
|
|
62
|
+
|
|
63
|
+
## Confidential Plans
|
|
64
|
+
|
|
65
|
+
Design docs and implementation plans are stored externally (not synced with this repo):
|
|
66
|
+
`~/repo/repo_plans/xelToFab/`
|
|
67
|
+
|
|
68
|
+
## docs/TODO.md — Feature Backlog
|
|
69
|
+
|
|
70
|
+
`docs/TODO.md` tracks deferred features and future work tiers. Update it when scoping new work or deferring functionality. Current tiers: quality-enhanced post-processing, Polyscope visualization, mesh-to-CAD, neural-enhanced pipeline.
|
|
71
|
+
|
|
72
|
+
## docs/PROGRESS.md — Incident Log & Project Memory
|
|
73
|
+
|
|
74
|
+
`docs/PROGRESS.md` is a living record of problems, solutions, and hard-won knowledge. Update it **immediately** when:
|
|
75
|
+
- A bug is found and fixed
|
|
76
|
+
- A failed approach is abandoned
|
|
77
|
+
- A non-obvious design decision is made
|
|
78
|
+
- A configuration or environment issue is resolved
|
|
79
|
+
- A test failure reveals a misunderstanding
|
|
80
|
+
|
|
81
|
+
Each entry **must** include:
|
|
82
|
+
1. **Problem** — What went wrong or what changed
|
|
83
|
+
2. **Root cause** — Why it happened
|
|
84
|
+
3. **Resolution** — How it was fixed (include the **Git commit ID**, e.g. `fix: 8e2ab7e`)
|
|
85
|
+
4. **Prevention** — How to avoid this class of problem in the future
|
|
86
|
+
|
|
87
|
+
**Critical rule: Do NOT repeat the same type of mistake.** Before starting any work, review `docs/PROGRESS.md` for past issues in the same area. If a similar problem has already been documented, follow the prevention guidance — repeating a documented mistake is unacceptable.
|
|
88
|
+
|
|
89
|
+
## Keeping Documentation in Sync
|
|
90
|
+
|
|
91
|
+
Before finishing a session:
|
|
92
|
+
1. Check changes made and update any stale docs
|
|
93
|
+
2. Update `docs/PROGRESS.md` with any issues encountered
|
|
94
|
+
3. Re-read this file for any instructions updated during the session
|
xeltofab-0.2.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zhao.MA
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
xeltofab-0.2.2/PKG-INFO
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xeltofab
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Design fields to fabrication-ready geometry
|
|
5
|
+
Project-URL: Homepage, https://xel-to-fab.github.io
|
|
6
|
+
Project-URL: Documentation, https://xel-to-fab.github.io
|
|
7
|
+
Project-URL: Repository, https://github.com/xarthurx/XelToFab
|
|
8
|
+
Project-URL: Issues, https://github.com/xarthurx/XelToFab/issues
|
|
9
|
+
Author-email: Zhao MA <zhma@ethz.ch>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Requires-Python: >=3.13
|
|
19
|
+
Requires-Dist: click>=8.3.1
|
|
20
|
+
Requires-Dist: marimo>=0.20.4
|
|
21
|
+
Requires-Dist: matplotlib>=3.10.8
|
|
22
|
+
Requires-Dist: numpy
|
|
23
|
+
Requires-Dist: plotly>=6.6.0
|
|
24
|
+
Requires-Dist: pydantic>=2.12.5
|
|
25
|
+
Requires-Dist: pyfqmr>=0.5.0
|
|
26
|
+
Requires-Dist: scikit-image
|
|
27
|
+
Requires-Dist: scipy
|
|
28
|
+
Requires-Dist: trimesh
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: gpytoolbox>=0.3.0; extra == 'all'
|
|
31
|
+
Requires-Dist: h5py>=3.10; extra == 'all'
|
|
32
|
+
Requires-Dist: manifold3d>=3.0; extra == 'all'
|
|
33
|
+
Requires-Dist: pymeshlab>=2023.12; extra == 'all'
|
|
34
|
+
Requires-Dist: pyvista>=0.43; extra == 'all'
|
|
35
|
+
Provides-Extra: all-formats
|
|
36
|
+
Requires-Dist: h5py>=3.10; extra == 'all-formats'
|
|
37
|
+
Requires-Dist: pyvista>=0.43; extra == 'all-formats'
|
|
38
|
+
Provides-Extra: cuda
|
|
39
|
+
Requires-Dist: isoext>=0.5; extra == 'cuda'
|
|
40
|
+
Provides-Extra: hdf5
|
|
41
|
+
Requires-Dist: h5py>=3.10; extra == 'hdf5'
|
|
42
|
+
Provides-Extra: manifold
|
|
43
|
+
Requires-Dist: manifold3d>=3.0; extra == 'manifold'
|
|
44
|
+
Provides-Extra: mesh-quality
|
|
45
|
+
Requires-Dist: gpytoolbox>=0.3.0; extra == 'mesh-quality'
|
|
46
|
+
Requires-Dist: pymeshlab>=2023.12; extra == 'mesh-quality'
|
|
47
|
+
Provides-Extra: vtk
|
|
48
|
+
Requires-Dist: pyvista>=0.43; extra == 'vtk'
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
|
|
51
|
+
<h1 align="center">XelToFab</h1>
|
|
52
|
+
|
|
53
|
+
<p align="center">
|
|
54
|
+
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.13%2B-blue.svg" alt="Python 3.13+"></a>
|
|
55
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License: MIT"></a>
|
|
56
|
+
</p>
|
|
57
|
+
|
|
58
|
+
A design field post-processing pipeline that transforms continuous scalar fields from optimization solvers and neural networks into clean, fabrication-ready triangle meshes (3D) and contour representations (2D). The pipeline handles thresholding, smoothing, mesh extraction, quality improvement, visualization, and multi-format export.
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install
|
|
64
|
+
uv sync
|
|
65
|
+
|
|
66
|
+
# Process a 3D density field into an STL mesh
|
|
67
|
+
uv run xtf process density.npy -o output.stl
|
|
68
|
+
|
|
69
|
+
# Process with custom parameters and save a comparison plot
|
|
70
|
+
uv run xtf process density.npy -o output.stl --threshold 0.4 --sigma 1.5 --viz
|
|
71
|
+
|
|
72
|
+
# Visualize a 2D density field
|
|
73
|
+
uv run xtf viz density_2d.npy -o comparison.png
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Pipeline
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Scalar Field → Preprocess → Extract → Smooth → Mesh/Contours
|
|
80
|
+
(.npy) threshold marching Taubin (.stl/.obj)
|
|
81
|
+
+ morphology cubes/sq. filter
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
1. **Preprocess** — Gaussian smoothing, Heaviside thresholding, morphological cleanup, small component removal
|
|
85
|
+
2. **Extract** — Marching cubes (3D) or marching squares (2D) via scikit-image
|
|
86
|
+
3. **Smooth** — Taubin smoothing via trimesh (3D meshes only)
|
|
87
|
+
|
|
88
|
+
## Python API
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
import numpy as np
|
|
92
|
+
from xeltofab.state import PipelineState, PipelineParams
|
|
93
|
+
from xeltofab.pipeline import process
|
|
94
|
+
from xeltofab.io import save_mesh
|
|
95
|
+
|
|
96
|
+
# Create a scalar field (e.g., a sphere)
|
|
97
|
+
z, y, x = np.mgrid[-1:1:50j, -1:1:50j, -1:1:50j]
|
|
98
|
+
field = (x**2 + y**2 + z**2 < 0.5**2).astype(float)
|
|
99
|
+
|
|
100
|
+
# Run the pipeline
|
|
101
|
+
params = PipelineParams(threshold=0.5, smooth_sigma=1.0)
|
|
102
|
+
state = PipelineState(field=field, params=params)
|
|
103
|
+
result = process(state)
|
|
104
|
+
|
|
105
|
+
# Export
|
|
106
|
+
save_mesh(result, "sphere.stl")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Using Example Data
|
|
110
|
+
|
|
111
|
+
Pre-computed topology optimization results are included in `data/examples/` (sourced from [IDEALLab EngiBench](https://huggingface.co/IDEALLab)):
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from xeltofab.io import load_field
|
|
115
|
+
from xeltofab.pipeline import process
|
|
116
|
+
|
|
117
|
+
state = load_field("data/examples/beams_2d_50x100_sample0.npy")
|
|
118
|
+
result = process(state)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Supported Input Formats
|
|
122
|
+
|
|
123
|
+
| Format | Extensions | Install |
|
|
124
|
+
|--------|-----------|---------|
|
|
125
|
+
| NumPy | .npy, .npz | Built-in |
|
|
126
|
+
| MATLAB | .mat | Built-in (via scipy) |
|
|
127
|
+
| CSV/Text | .csv, .txt | Built-in |
|
|
128
|
+
| VTK | .vtk, .vtr, .vti | `uv sync --extra vtk` |
|
|
129
|
+
| HDF5/XDMF | .h5, .hdf5, .xdmf | `uv sync --extra hdf5` |
|
|
130
|
+
| All formats | — | `uv sync --extra all-formats` |
|
|
131
|
+
|
|
132
|
+
List available formats: `uv run xtf formats`
|
|
133
|
+
|
|
134
|
+
## Development
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
uv sync # Install deps
|
|
138
|
+
uv run pytest tests/ -v # Run tests
|
|
139
|
+
uv run ruff check src/ tests/ # Lint
|
|
140
|
+
uv run ruff format src/ tests/ # Format
|
|
141
|
+
uv run marimo edit notebooks/demo.py # Interactive demo
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Project Structure
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
src/xeltofab/
|
|
148
|
+
├── state.py Pipeline state + parameter models
|
|
149
|
+
├── preprocess.py Field preprocessing
|
|
150
|
+
├── extract.py Mesh/contour extraction
|
|
151
|
+
├── smooth.py Taubin smoothing
|
|
152
|
+
├── pipeline.py Orchestrator
|
|
153
|
+
├── io.py File I/O (multi-format load, mesh export)
|
|
154
|
+
├── loaders/ Format-specific loaders (numpy, matlab, csv, vtk, hdf5)
|
|
155
|
+
├── field_plots.py Matplotlib visualization
|
|
156
|
+
└── cli.py CLI (xtf)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for detailed architecture documentation.
|
|
160
|
+
|
|
161
|
+
## Requirements
|
|
162
|
+
|
|
163
|
+
- Python 3.13+
|
|
164
|
+
- [uv](https://docs.astral.sh/uv/) for project management
|
xeltofab-0.2.2/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<h1 align="center">XelToFab</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.13%2B-blue.svg" alt="Python 3.13+"></a>
|
|
5
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License: MIT"></a>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
A design field post-processing pipeline that transforms continuous scalar fields from optimization solvers and neural networks into clean, fabrication-ready triangle meshes (3D) and contour representations (2D). The pipeline handles thresholding, smoothing, mesh extraction, quality improvement, visualization, and multi-format export.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Install
|
|
14
|
+
uv sync
|
|
15
|
+
|
|
16
|
+
# Process a 3D density field into an STL mesh
|
|
17
|
+
uv run xtf process density.npy -o output.stl
|
|
18
|
+
|
|
19
|
+
# Process with custom parameters and save a comparison plot
|
|
20
|
+
uv run xtf process density.npy -o output.stl --threshold 0.4 --sigma 1.5 --viz
|
|
21
|
+
|
|
22
|
+
# Visualize a 2D density field
|
|
23
|
+
uv run xtf viz density_2d.npy -o comparison.png
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Pipeline
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Scalar Field → Preprocess → Extract → Smooth → Mesh/Contours
|
|
30
|
+
(.npy) threshold marching Taubin (.stl/.obj)
|
|
31
|
+
+ morphology cubes/sq. filter
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
1. **Preprocess** — Gaussian smoothing, Heaviside thresholding, morphological cleanup, small component removal
|
|
35
|
+
2. **Extract** — Marching cubes (3D) or marching squares (2D) via scikit-image
|
|
36
|
+
3. **Smooth** — Taubin smoothing via trimesh (3D meshes only)
|
|
37
|
+
|
|
38
|
+
## Python API
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import numpy as np
|
|
42
|
+
from xeltofab.state import PipelineState, PipelineParams
|
|
43
|
+
from xeltofab.pipeline import process
|
|
44
|
+
from xeltofab.io import save_mesh
|
|
45
|
+
|
|
46
|
+
# Create a scalar field (e.g., a sphere)
|
|
47
|
+
z, y, x = np.mgrid[-1:1:50j, -1:1:50j, -1:1:50j]
|
|
48
|
+
field = (x**2 + y**2 + z**2 < 0.5**2).astype(float)
|
|
49
|
+
|
|
50
|
+
# Run the pipeline
|
|
51
|
+
params = PipelineParams(threshold=0.5, smooth_sigma=1.0)
|
|
52
|
+
state = PipelineState(field=field, params=params)
|
|
53
|
+
result = process(state)
|
|
54
|
+
|
|
55
|
+
# Export
|
|
56
|
+
save_mesh(result, "sphere.stl")
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Using Example Data
|
|
60
|
+
|
|
61
|
+
Pre-computed topology optimization results are included in `data/examples/` (sourced from [IDEALLab EngiBench](https://huggingface.co/IDEALLab)):
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from xeltofab.io import load_field
|
|
65
|
+
from xeltofab.pipeline import process
|
|
66
|
+
|
|
67
|
+
state = load_field("data/examples/beams_2d_50x100_sample0.npy")
|
|
68
|
+
result = process(state)
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Supported Input Formats
|
|
72
|
+
|
|
73
|
+
| Format | Extensions | Install |
|
|
74
|
+
|--------|-----------|---------|
|
|
75
|
+
| NumPy | .npy, .npz | Built-in |
|
|
76
|
+
| MATLAB | .mat | Built-in (via scipy) |
|
|
77
|
+
| CSV/Text | .csv, .txt | Built-in |
|
|
78
|
+
| VTK | .vtk, .vtr, .vti | `uv sync --extra vtk` |
|
|
79
|
+
| HDF5/XDMF | .h5, .hdf5, .xdmf | `uv sync --extra hdf5` |
|
|
80
|
+
| All formats | — | `uv sync --extra all-formats` |
|
|
81
|
+
|
|
82
|
+
List available formats: `uv run xtf formats`
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uv sync # Install deps
|
|
88
|
+
uv run pytest tests/ -v # Run tests
|
|
89
|
+
uv run ruff check src/ tests/ # Lint
|
|
90
|
+
uv run ruff format src/ tests/ # Format
|
|
91
|
+
uv run marimo edit notebooks/demo.py # Interactive demo
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Project Structure
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
src/xeltofab/
|
|
98
|
+
├── state.py Pipeline state + parameter models
|
|
99
|
+
├── preprocess.py Field preprocessing
|
|
100
|
+
├── extract.py Mesh/contour extraction
|
|
101
|
+
├── smooth.py Taubin smoothing
|
|
102
|
+
├── pipeline.py Orchestrator
|
|
103
|
+
├── io.py File I/O (multi-format load, mesh export)
|
|
104
|
+
├── loaders/ Format-specific loaders (numpy, matlab, csv, vtk, hdf5)
|
|
105
|
+
├── field_plots.py Matplotlib visualization
|
|
106
|
+
└── cli.py CLI (xtf)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for detailed architecture documentation.
|
|
110
|
+
|
|
111
|
+
## Requirements
|
|
112
|
+
|
|
113
|
+
- Python 3.13+
|
|
114
|
+
- [uv](https://docs.astral.sh/uv/) for project management
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|