{"id":39406254,"url":"https://github.com/andywar65/django-cad-inspector","last_synced_at":"2026-01-18T03:31:07.556Z","repository":{"id":257929344,"uuid":"870595847","full_name":"andywar65/django-cad-inspector","owner":"andywar65","description":"Import CAD drawings into Django and inspect them in VR","archived":false,"fork":false,"pushed_at":"2025-11-10T19:13:35.000Z","size":241,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T09:32:38.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andywar65.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-10T10:25:46.000Z","updated_at":"2025-05-27T10:44:57.000Z","dependencies_parsed_at":"2024-10-25T19:25:17.926Z","dependency_job_id":"0d456524-cafc-40df-88d4-6b6571a56010","html_url":"https://github.com/andywar65/django-cad-inspector","commit_stats":null,"previous_names":["andywar65/django-cad-inspector"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andywar65/django-cad-inspector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywar65%2Fdjango-cad-inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywar65%2Fdjango-cad-inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywar65%2Fdjango-cad-inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywar65%2Fdjango-cad-inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andywar65","download_url":"https://codeload.github.com/andywar65/django-cad-inspector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andywar65%2Fdjango-cad-inspector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-18T03:31:06.908Z","updated_at":"2026-01-18T03:31:07.545Z","avatar_url":"https://github.com/andywar65.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-cad-inspector\nImport CAD drawings into [Django](https://djangoproject.com) and inspect them in VR with [A-Frame](https://aframe.io/docs/1.6.0/introduction/)\n## Requirements\nThis project is tested on Django 5.2 and Python 3.13. It heavily relies on outstanding [ezdxf](https://ezdxf.mozman.at/) for handling DXF files, [django-colorfield](https://github.com/fabiocaccamo/django-colorfield) for admin color fields.\n## Installation from PyPI\nWARNING: see below before upgrading to version 0.4.0, breaking changes!\nActivate your virtual environment and install with:\n```\npython -m pip install django-cad-inspector\n```\nIn your Django project add:\n```python\nINSTALLED_APPS = [\n    # ...\n    \"colorfield\",\n    \"django_cad_inspector\",\n]\n```\n```python\n# my_project/urls.py\nurlpatterns = [\n    # ...\n    path('3d/', include('django_cad_inspector.urls', namespace = 'django_cad_inspector')),\n]\n```\nAdd two lists to `my_project/settings.py`:\n```python\nCAD_LAYER_BLACKLIST = [...]\nCAD_BLOCK_BLACKLIST = [...]\n```\nHere you can store names of layers and blocks you don't want to be processed.\nMigrate and create a superuser.\n### Upgrading to version \u003e=0.4.0 from earlier\nSome breaking changes (app name change). Before upgrading download your models as fixtures: `python manage.py dumpdata cadinspector -o somefile.json`, open the file and change all occourences of `cadinspector.` into `django_cad_inspector.`. Finally upgrade the package and reload the fixtures: `python manage.py loaddata somefile.json`\n### Templates\nYou also need a `base.html` template with following template blocks (a sample `base.html` is provided among package templates).\n```\n{% block extra-head %}\n{% end block extra-head %}\n...\n{% block content %}\n{% endblock content %}\n```\nPackage comes with four templates, `django_cad_inspector/entity_list.html`, `django_cad_inspector/entity_detail.html`, `django_cad_inspector/scene_list.html` and `django_cad_inspector/scene_detail.html`. Copy and override them in your project templates if you want to add your styles.\n## Usage\nRun the server and navigate to `http://127.0.0.1:8000/3d`: you will be presented with a `Scene list`. Of course there still are no scenes, so clik on the details and on the `Add Scene` link. Enter your credentials to access the `admin site`.\n### Scenes from a DXF\nEnter title, description and eventually an `Equirectangular image` to simulate the environment, then upload a `DXF` file (it is a `CAD` exchange file). The `DXF` file must contain some `meshes` (if you have `3DSolids` you have to convert them to `Meshes`). Click on the `Save and continue` button.  Thanks to the outstanding [ezdxf](https://ezdxf.mozman.at/) library, meshes are converted to `*.obj files`, incorporated into `Entity` models and associated to the `Scene` via `Staging` inlines. Each Staging holds information for position, rotation, scale, color (extracted from the `CAD Layer` the mesh belonged to) and some data (more on that later). WARNING: updating the `DXF file` will remove all entities staged on the Scene, but not the entities.\nAlso `CAD Blocks` with `meshes` will be imported, each `Block` will be transformed into an `Entity`, while `Insertions` will be transformed into `Stagings` and associated to the `Scene`. In the case of `Blocks`, the appended data will contain also `Block attributes`. WARNING, some restrictions occour for insertions when pitch rotation is 90 or -90 degrees.\nVisit the site at `http://127.0.0.1:8000/3d` again. Finally the `Scene` is listed. Click on the link and access the `A-Frame` virtual reality: hold down the right mouse button to look around, and use `WASD` keys to move. When the cursor moves on an object and you click on it, a popup with data should appear (if data is associated to the staged entity). Leave the object and the popup will disappear.\n### Entities\nYou can create `Entities` navigating to `http://127.0.0.1:8000/admin/django_cad_inspector/entity/add/`: enter a Title and Description, then upload an `*.obj file`. If provided, the associated `*.mtl file` and eventual images. Check the `Switch` field if your object was created in CAD: A-Frame coordinate system is rotated with respect to CAD coordinate system.\nAlternatively you can upload a `*.gltf file`, which is the recommended format in A-Frame. If uploaded, all other formats will be ignored.\n### Add Entities to Scenes\nIn `http://127.0.0.1:8000/admin/django_cad_inspector/scene/` choose a Scene to update. Add a `Staged entity`, select one of the `Entities` you created previously, adjust `color`, `position`, `rotation` and `scale`. Stage as many entities you want (even multiple specimens of the same entity), then update the Scene.\n### Shadows\nWhen inspecting a scene, click on the dropdown next to the scene title: you will be able to inspect the scene without popups and / or with shadows casted on entities. The latter functionality is resource consuming.\n## Entity utilities\nNavigating to `http://127.0.0.1:8000/admin/django_cad_inspector/entity/` shows list of existing `Entities`. Two admin actions are implemented to manage them:\n### Check file names\nUploading `*.mtl file` and images in Django may change their filename, i.e. to avoid duplicate filenames. This can lead `*.obj files` and `*.mtl files` to miss their assets (filenames are hardcoded within these files). Select corrupted `Entities` and run the routine: hardcoded filenames will be rewritten to match actual uploaded filenames.\n### Delete unstaged entities\nAs seen before, deleting a `Staging` does not delete the corresponding `Entity`, which can be staged in multiple `Scenes`. Select all `Entities` and run this routine if you want to get rid of unstaged ones.\n## A-Frame Visual Inspector\nOnce in the A-Frame window, if you press `Ctrl + Alt + i` you will open the [A-Frame Visual Inspector](https://aframe.io/docs/1.6.0/introduction/visual-inspector-and-dev-tools.html). It's possible to modify objects in the Inspector, save a `*.gltf file` from the whole scene, and then add it to an `Entity`.\n## Next steps\nCreate entities with lights, add some physics.\n## Tests\nTesting is done with unittest. At the moment coverage is 97%. Tested for Django 4.2 against Python 3.9, 3.10, 3.11, 3.12 versions, for Django 5.1 against Python 3.10, 3.11, 3.12 versions (3.13 on Windows) and Django 5.2 against Python 3.13.1.\n## Changelog\n- 0.5.0: Using Django 5.2\n- 0.4.0: Breaking change: change of app name, see install\n- 0.3.2: Also Stagings in admin\n- 0.3.1: Small fix to lamp position\n- 0.3.0: Staged entities may be presented in wireframe mode (if upgrading from 0.2.0, migrate models). Popups show up when the entity is clicked on. You can turn on shadows casted by a portable lamp.\n- 0.2.0: First working version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywar65%2Fdjango-cad-inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandywar65%2Fdjango-cad-inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandywar65%2Fdjango-cad-inspector/lists"}