Practical Visual-Assisted Programming: 3D Retail Store Modeling and Acceptance Testing

    A reliable 3D store scene requires more than generating code that renders successfully. This article presents a practical workflow for defining deliverables, separating architectural constraints from editable assets, maintaining consistent camera views between unfinished and decorated states, combining geometric validation with visual review, and managing iterative fixes with regression checks. The approach helps turn spatial requirements into explicit, repeatable constraints for browser-based 3D prototypes.

    1. Define the Deliverable Before Generating the Scene

    The value of visual-assisted programming is not limited to turning written requirements into code. It also makes the generated result executable, observable, and easier to correct. A 3D retail store is a typical example: spatial layout, component dimensions, material assignments, and camera interactions can all be represented in code. However, successful execution does not prove that the space is correct. A doorway may be blocked by a partition, tables and chairs may extend into the main aisle, or the divider and soup surface in a close-up view of a hot pot may not align correctly.

    Consider a 450-square-meter unfinished store. The deliverable should not be a few rendered images, but a browser-viewable 3D scene. Users should be able to enter the lobby and private rooms from the street-facing storefront, switch between preset camera positions, and drag the view to inspect local details. When switching between unfinished and decorated states from any viewpoint, the building shell and camera position should remain unchanged.

    Writing these requirements into the task description prevents the generation process from optimizing for the appearance of a single image while neglecting spatial structure and interaction behavior.

    2. Separate Architectural Constraints from Rendering Code

    A 3D scene should establish a consistent coordinate system and unit convention before generating any furniture or decoration. For example, use meters as the internal length unit, set the projection of the entrance center onto the floor as the origin, and explicitly define the vertical direction and the direction from the entrance toward the interior.

    The building outline, opening positions, and column dimensions should be based on drawings or on-site measurements. If only the total area is available, a schematic base model can be created, but any unconfirmed values must be clearly marked as estimates rather than treated as measured data.

    Scene data can be divided into three groups:

    • Fixed components: The building outline, floor, four structural columns, and existing doors and windows. Each component should have a stable identifier so that different scene states can be compared reliably. Object creation order should not be used to determine what a component represents.
    • Circulation and clearance constraints: Represent the 2.6-meter central aisle as a clearance zone that must remain available. Doorways and other entrances that must stay unobstructed should be modeled in the same way. The goal is not merely to check the distance between two lines on a plan, but to verify that the space remains practically usable after furniture is placed.
    • Editable decoration objects: Storefront finishes, wooden partitions, tables, chairs, booths, lighting fixtures, tableware, and similar assets. Editable objects should be associated with their regions or parent components. For example, tableware should be positioned relative to the tabletop rather than as independent global coordinates. When the table moves, its contents should move with it.

    This separation also makes code-generation tasks easier to constrain. When revising the lobby layout, the model may adjust tables, chairs, and booths, but it should not move structural columns or narrow the main aisle. Separating fixed and editable data, followed by a difference check after generation, is more reliable than repeatedly telling the model not to change the structure.

    3. Use a Shared Base Model for Reliable Camera-Matched Comparisons

    The key to comparing unfinished and decorated states is to ensure that changes come only from the content being switched. If the unfinished and decorated scenes are generated independently, they may look similar while still differing in wall thickness, doorway positions, or floor elevation. When the state changes, these inconsistencies can cause outlines to jump, making it difficult for reviewers to determine whether they are seeing a design change or a modeling error.

    A more reliable approach is to reuse the same architectural base model, organize newly added decoration as independent layers, and switch the relevant surface materials or decorative objects according to the scene state.

    View state and decoration state should be managed separately. A button should switch the decoration layer without resetting the camera position, orientation, field of view, or the target of the interaction controller. This allows users to compare the two states from a preset camera position or from a manually dragged viewpoint near a column or table.

    The comparison should also serve two different purposes:

    • For design presentation, decorated lighting and materials can be enabled to communicate the atmosphere of the space.
    • For structural verification, the output dimensions and camera should remain fixed. If necessary, use consistent lighting or an outline view so that brightness changes are not mistaken for geometric changes.

    Both views can reuse the same scene. Maintaining two disconnected sets of assets is unnecessary.

    4. Use Geometry Rules for Decisions and Screenshots for Visual Diagnosis

    In a runnable preview environment, visual feedback is useful for finding issues where the program runs without errors but the image is wrong. It cannot replace geometric validation. A screenshot proves only what is visible from one viewpoint; hidden intersections, blocked objects, and unclear clearance areas may still exist. The recommended sequence is therefore to run rule-based checks first, then review screenshots from predefined camera positions.

    Prioritize Geometry Checks for Layout and Clearance

    For tables, chairs, booths, and partitions, begin with planar footprint checks to identify conflicts with aisles, columns, and doorways. For rotated components or irregular shapes, axis-aligned bounding boxes may produce false positives, so follow them with a contour check that respects the actual orientation.

    Not every intersection is an error. A table leg touching the floor and tableware resting on a tabletop are expected relationships. A partition intruding into a private-room doorway is a layout defect. Validation rules should distinguish permitted contact from prohibited penetration.

    Use Camera Positions at Multiple Scales

    Different camera positions should be used for different inspection tasks:

    • Street-facing view: Check whether the storefront, entrance canopy, and the interior depth visible through the glass form a coherent sequence.
    • Lobby view: Include both structural columns and aisle boundaries to reveal whether furniture on either side reduces usable circulation space.
    • Private-room entrance view: Look along the entry direction and focus on the relationship between the doorway, partition, and interior tabletop.
    • Dining-table close-up: Inspect local details separately, since issues such as the divider and soup surfaces in a split hot pot are nearly impossible to judge from a full-room view.

    For example, if the red and white soup surfaces in a split hot pot appear to cross the divider, changing only the colors will not solve the problem. First verify that the divider and both soup surfaces share the same local coordinate system. Then confirm that the partition boundary follows the divider. If the geometry is correct, investigate material assignment or surface overlap.

    The same principle applies to a teacup. The rim, inner wall, and liquid surface should be treated as distinct elements. A single colored plane aligned with the rim should not be used as a substitute for liquid inside the cup. Reducing an issue from “it looks wrong” to a specific object and spatial relationship makes the fix more stable.

    5. Give Every Revision a Defined Scope and Regression Result

    Visual-assisted programming works best as an iterative cycle:

    Generate → preview → locate → fix → revalidate

    Instead of rebuilding the entire store whenever an issue is found, record each problem with at least the following information:

    • Scene state
    • Screenshot camera position
    • Abnormal object
    • Expected appearance or relationship
    • Scope of the fix

    For example, “In the decorated state, the left partition intrudes into the doorway from the private-room entrance view; adjust only the partition and do not change the original doorway or camera parameters” is much easier to execute and verify than “Make the private room look more natural.”

    After each update, rerun geometric checks for the affected region and generate comparison screenshots under the same conditions. If the lobby furniture is adjusted, review the columns, aisle, and adjacent entrances as well rather than checking only whether the furniture looks better.

    If the camera or interaction behavior is changed, switch the decoration layer from both preset camera positions and freely dragged viewpoints to confirm that the view has not been reset unexpectedly. Preserve scene configuration, version records, and key screenshots to help distinguish issues caused by code changes, asset changes, or camera changes.

    Before delivery, the scene can be considered usable when three conditions are met:

    • Fixed architectural conditions can be verified.
    • Critical circulation areas can be checked.
    • Local visual defects can be reproduced and corrected.

    This workflow supports design communication and prototype validation. It does not replace structural, fire-safety, or construction review. Its reusable value is not the decorative style of a hot pot restaurant, but the process of converting spatial requirements into explicit constraints and then using repeatable checks to verify that the code has implemented those constraints in both the rendered scene and its interactions.