LLM-Driven 3D Modeling with Code: From Individual Objects to Entire Cities

    Large language models can create editable 3D assets and interactive city scenes by writing code rather than directly generating meshes or manipulating software interfaces. This article examines reference-image modeling and data-driven city generation, explains their workflows and engineering benefits, and outlines practical limitations and implementation advice.

    1. Why AI-Assisted 3D Creation Is Gaining Attention

    Using large language models (LLMs) to create 3D content has become a popular area of experimentation among developers. Examples range from reconstructing editable objects from photographs to building entire interactive cities in a browser.

    The important shift is not simply that AI can produce 3D models. It is how those models are created.

    Traditional approaches typically involve either text-to-3D systems that output meshes directly or AI systems that manipulate a modeling application’s interface much as a human would. A different approach is now gaining traction: LLMs write code that builds the scene.

    The model generates Python scripts that use a 3D application’s scripting API to create geometry, materials, and scene layouts. It can then inspect rendered results and revise the scripts.

    This code-driven workflow offers several advantages: the generation process is controllable, the results remain editable, and individual steps can be reproduced and debugged. Two types of projects illustrate how it works.

    2. Reference-Based Modeling: Turning Images into Editable Assets

    One of the most practical applications is reconstructing a 3D object from a photograph, hand-drawn sketch, or engineering drawing.

    A typical workflow follows five steps:

    1. Provide reference images. For example, supply a three-view engineering drawing of a vintage steam locomotive.
    2. Analyze the structure. The LLM identifies components such as wheels, the boiler, chimney, and cab, along with their relative positions and proportions.
    3. Generate a modeling script. The model writes Python code that calls the 3D application’s API, using primitive geometry, Boolean operations, and curve lofting to construct the components.
    4. Render, compare, and iterate. After the script runs, the system renders a preview. The LLM compares it with the reference and adjusts script parameters to reduce discrepancies.
    5. Deliver a structured scene. Instead of a single undifferentiated mesh, the output can be a hierarchical scene containing thousands of separately named objects.

    In one widely circulated locomotive example, an LLM reportedly generated a model with roughly 3,000 individual objects in a few minutes. The wheels, boiler, chimney, and cab remained separate, allowing users to select and edit them independently, replace their materials, or change their level of detail.

    For example, a user could request an increase from 12 wheel spokes to 24. A later request to break the locomotive down into a parts list could also be handled because the scene had been built as a structured assembly in code.

    Parameterization Is the Key Engineering Advantage

    Code-driven modeling lends itself naturally to parameterization. Dimensions, counts, and positions can be expressed as variables, making assets reusable and easy to modify.

    1. # Illustrative pseudocode: generate a parametric locomotive wheel
    2. def make_wheel(radius=0.5, spokes=12, thickness=0.1):
    3. rim = torus(radius=radius, tube=thickness)
    4. hub = cylinder(radius=radius*0.15, depth=thickness*2)
    5. parts = [rim, hub]
    6. for i in range(spokes):
    7. angle = 2 * math.pi * i / spokes
    8. parts.append(box_between(hub_pos, rim_pos(angle)))
    9. return join(parts, name=f"wheel_{spokes}spokes")

    Changing the parameters produces wheels with different specifications. Achieving the same range of variations through manual modeling is typically more labor-intensive.

    3. Scene-Level Generation: From One Object to an Entire City

    Once the workflow works for individual objects, it can be extended to city-scale scenes.

    In another widely shared example, a user asked an LLM to turn a real city into a browsable 3D world. According to the account, a browser-accessible “miniature city” was online a little over 40 minutes later.

    The resulting scene reportedly included:

    • Coverage of all the city’s administrative districts and surrounding areas, with more than 200,000 simplified building models.
    • Camera rotation, zooming, and panning, plus lighting modes for daytime, dusk, and night.
    • Automated fly-through tours of more than a dozen landmarks, with touchscreen interaction on mobile devices.
    • Plugin-free browser rendering using WebGL and a front-end 3D library such as Three.js.

    How the City-Generation Pipeline Works

    The technical workflow can be broken down into four stages:

    1. Acquire geographic data. Read public map data, such as OpenStreetMap-style crowdsourced geographic datasets, to obtain building footprints, heights, and related attributes.
    2. Generate geometry. Extrude two-dimensional footprints according to building heights to create simplified building volumes, with additional detail for selected landmarks.
    3. Organize the scene. Partition the buildings into chunks and use instancing where appropriate to manage rendering overhead.
    4. Implement interaction and deploy. Add camera controls, lighting changes, and animated flight paths, then package and deploy the front-end application.

    According to the project’s author, the data pipeline had not been designed in advance. The LLM assembled the workflow from data cleaning through deployment in response to a single request.

    That claim should be understood alongside the technical scope of the result. This kind of city generation is fundamentally a simplified representation: it extrudes geometry from open geographic data rather than reconstructing detailed building facades.

    The output is therefore closer to a city base layer for data visualization than a photorealistic digital twin. Even with that limitation, the example illustrates how code generation can reduce the effort required to turn an idea into an interactive 3D scene.

    4. Engineering Value and Suitable Use Cases

    For developers and businesses, the main value of code-driven AI modeling lies in four areas.

    Faster Asset Production

    During proof-of-concept work, the workflow can produce structurally organized, editable models in minutes. In suitable cases, this can replace days of manual blockout modeling.

    A Lower Barrier to Scene Creation

    Teams can begin building game prototypes, digital-twin base layers, visualization dashboards, and educational demonstrations without requiring a specialist modeler for every initial task.

    Integration with Software Engineering Workflows

    The script becomes the asset’s source code. It can be stored in version control and integrated into automation pipelines and batch-generation processes.

    This makes 3D production more compatible with established software development practices.

    Cloud-Friendly Collaboration and Automation

    These workflows commonly rely on LLM inference through APIs. Combined with general-purpose cloud services such as serverless functions and object storage, they can be packaged into automated services that accept reference images and return downloadable assets.

    Where the Approach Still Falls Short

    The strongest use cases are objects with regular structures that can be described parametrically, along with large scenes generated from structured data.

    High-fidelity organic forms, complex UV layouts, and assets requiring hand-sculpted surface detail still need substantial involvement from traditional art workflows.

    A practical division of responsibility is to let AI build the structured foundation and generate repetitive scene elements, while people handle artistic refinement and quality control.

    5. Practical Recommendations

    For teams experimenting with this approach, the following progression is useful:

    • Start with simple geometry. Use low-poly mechanical objects to validate the full loop of script generation, rendering, review, and revision.
    • Feed rendered images back to the model. Letting the LLM inspect its own output is important for improving visual fidelity and closing the feedback loop.
    • Use open data for scene-scale projects. Public geographic datasets are a practical starting point for city generation.
    • Manage scale and rendering performance. Instanced rendering and chunked loading, similar to a tile-based approach, are important for keeping large browser scenes responsive.
    • Keep the generation scripts. Store them in a code repository. Future revisions can be much easier than editing generated mesh files directly.

    Conclusion

    LLM-driven 3D modeling is significant because it shifts part of 3D content production from manual construction to programmable engineering.

    Its value is not that it eliminates modeling expertise. Rather, it provides a reproducible way to build editable structures, generate variations, and assemble large data-driven scenes. For teams looking to lower the barrier to 3D content creation, it is a practical workflow worth testing.