
How to Make an App Like Sweet Home 3D

Building a home design application like Sweet Home 3D is a genuinely interesting engineering challenge. It sits at the intersection of 2D/3D rendering, file I/O, real-time interaction, and cross-platform distribution. This post walks through the core architecture decisions you'll face, the libraries that do the heavy lifting, and the trade-offs worth thinking through before you write a line of code.
What Kind of App Are You Actually Building?
Sweet Home 3D is a desktop-first, Java-based floor plan editor. It lets users draw walls in 2D, furnish a room, and preview the result in a 3D view simultaneously. Replicating that product means you're building:
- A 2D vector canvas with snapping, grid alignment, and constraint-based geometry
- A 3D renderer that updates in real time as the user edits the 2D plan
- A furniture catalogue backed by a file format (Sweet Home 3D uses
.sh3d, which is a ZIP with OBJ/MTL assets inside) - An undo/redo history stack with fine-grained state management
- Import/export for standard formats: OBJ, DAE (Collada), and optionally IFC for BIM workflows
If you're building a web app instead of a desktop tool, the rendering stack changes significantly. A Java Swing app and a browser-based app are architecturally different products, even if the UX looks similar.
Choosing Your Rendering Stack
This is the decision that shapes everything else.
Desktop (Java / JavaFX)
Sweet Home 3D uses Java3D historically, then migrated parts to Java3D alternatives and JMonkeyEngine for 3D. If you're forking or extending Sweet Home 3D directly, you're in this ecosystem. Java3D is largely unmaintained now. JMonkeyEngine 3.6+ is actively maintained and a reasonable choice for a desktop 3D tool.
For the 2D canvas in a desktop app, JavaFX's Canvas API works, or you can go lower and use a custom JPanel with Java2D. The constraint system for wall snapping is custom code either way.
Web (Browser-Based)
If your target is a web app, Three.js r160+ is the standard starting point for the 3D view. It has good OBJ and GLTF loaders built in. For the 2D plan editor, Fabric.js or Konva.js handle canvas interaction well, though you'll need to write your own wall snapping and room detection logic.
A dual-view architecture (2D plan + 3D preview side by side) on the web requires keeping two scene graphs in sync. The cleanest approach is a single shared data model that both views subscribe to. A reactive state library like Zustand or Jotai (if you're on React) works well here. Every wall segment mutation triggers a re-render in both views.
Mobile
Mobile is where you'll make the most compromises. Real-time 3D rendering on mobile is viable with SceneKit (iOS) or Filament (Android/cross-platform), but the input model is different. Desktop apps rely on hover, right-click, and keyboard shortcuts that don't exist on touch. You either redesign the interaction model entirely or build a companion app that is genuinely simpler than the desktop version.
How Do You Model Rooms, Walls, and Furniture?
The data model is not glamorous work, but getting it wrong costs you six months later.
Walls in Sweet Home 3D are defined by two endpoints, a thickness, and a height. Rooms are inferred from enclosed wall polygons. This sounds simple until you handle T-junctions, curved walls, and walls that don't quite meet at a corner.
A practical approach:
- Store walls as directed line segments with a UUID, start point, end point, thickness, and height.
- Use a polygon detection algorithm (the half-edge data structure is standard here) to compute room boundaries.
- Store furniture as instances referencing a catalogue entry, with a position, rotation, and scale override.
The catalogue itself is typically a directory of 3D model files plus a metadata XML or JSON file. Sweet Home 3D's own catalogue format is well-documented and reusable if you're targeting compatibility with its .sh3d files.
For undo/redo, Command Pattern is the right structure. Every user action (add wall, move furniture, resize room) is an object that knows how to execute and reverse itself. Keep a stack of these. 50 to 100 levels of history is a reasonable default.
/// Not sure where to start?
Get the architecture before you commit
Tell us what you're building and we'll map the technical approach, stack, and rough timeline. No cost, no obligation, no sales call required.
What Does the File Format Look Like?
The .sh3d format is a ZIP archive containing:
Home.xml: the main document, describing walls, rooms, furniture instances, cameras, and environment settings*.obj/*.mtl: 3D model assets for any custom furniture- Texture images in standard formats
If you're building a compatible app, parsing this format is straightforward with any ZIP library and a standard XML parser. The schema is documented in the Sweet Home 3D source repository on SourceForge.
If you're building your own format, prefer a ZIP-based container with a JSON document inside. JSON is easier to diff (useful for collaborative editing later) and more readable than XML. Store 3D assets as GLTF 2.0 rather than OBJ. GLTF supports PBR materials, which OBJ does not, and most modern renderers have first-class GLTF loaders.
How Do You Handle the 3D Rendering Performance?
Real-time 3D in a floor plan tool doesn't need to be photorealistic. It needs to be fast and predictable.
A few things that matter practically:
- Instanced rendering: If the user places 30 identical chairs, render them as one draw call with instanced geometry. Three.js
InstancedMeshhandles this. JMonkeyEngine hasInstancedNode. - Level of detail: Furniture models in the catalogue should have at least two LOD levels. A chair visible at the far end of a room doesn't need 5,000 polygons.
- Frustum culling: Any mature 3D engine handles this automatically, but verify it's enabled. Culling walls and furniture outside the camera's view is the single biggest frame rate win in large floor plans.
- Texture atlasing: Batching furniture textures into atlases reduces draw calls significantly, particularly on mobile.
For a photorealistic output mode (a "render" button, not the live view), you have two real options: bake the scene and run a path tracer locally, or send the scene to a cloud rendering service. Local path tracing with a library like Mitsuba 3 or Blender's Cycles (invoked as a subprocess) is feasible for a desktop app. For web, you'd typically offload this to a server.
Collaboration, Cloud Sync, and Multi-User Editing
Sweet Home 3D is a single-user, local-file application. If you want multi-user editing, you're building a significantly more complex system.
Operational Transformation (OT) or CRDTs are the standard approaches for collaborative document editing. For a spatial data model (walls, furniture positions), a CRDT like Yjs with a custom document type is more practical than a full OT implementation. Yjs has good WebSocket and WebRTC transport adapters.
Cloud sync without real-time collaboration is simpler: save the document to S3 or equivalent on every change (debounced), and handle conflict resolution with a last-write-wins or version-vector strategy. This is a good enough starting point for most products.
Conclusion
The core of a Sweet Home 3D-style app is a synced 2D/3D data model, a reliable wall and room geometry system, and a rendering stack suited to your target platform. Pick your platform first, because the rendering technology choice follows from it. For a web app, Three.js plus a reactive state layer is the most mature path in 2024. For desktop, JMonkeyEngine or a Qt/C++ stack if you need maximum performance.
Start with the data model and the file format. Get those right, and the rendering is a solvable problem. Get them wrong, and you'll be migrating data mid-project.
If you're at the stage of scoping this out and want a second opinion on the architecture, the Sodio team is happy to review your approach.
FAQ
How long does it take to build an app like Sweet Home 3D? A fully featured desktop clone with a furniture catalogue, real-time 3D preview, and file import/export is a 12 to 18-month project for a team of three to four engineers. A web-based MVP with core floor plan editing and basic 3D view is achievable in four to six months. The timeline depends heavily on whether you need photorealistic rendering and collaboration features.
Which is better for this kind of app: a web app or a desktop app? Desktop gives you access to the GPU without browser sandbox limitations, easier file system access, and no network dependency for large 3D model libraries. Web is easier to distribute and update. If your users are professionals working with large floor plans, desktop performance wins. If your users are consumers doing quick room layouts, web is the right call.
Can you use Sweet Home 3D's furniture library in your own app? Sweet Home 3D's default furniture library is licensed under the Free Art License. You can use the 3D models in compatible applications, but check individual model attributions. Third-party models contributed to the catalogue may carry different licences. When in doubt, build your own catalogue or license a commercial 3D asset library like Turbosquid.
Do you need a game engine for a floor plan app? Not necessarily. A dedicated game engine like Unity or Unreal adds significant overhead (binary size, licensing, integration complexity) that is rarely worth it for a floor plan tool. Three.js on the web or JMonkeyEngine on desktop are purpose-fit for this scale of 3D. Use a game engine only if you need real-time global illumination or physics simulation in the 3D view.
What's the hardest part of building this type of app? The wall geometry system. Handling T-junctions, wall joins at arbitrary angles, walls that nearly meet but don't, and room polygon detection correctly is where most teams underestimate effort. Plan at least four to six weeks for this subsystem alone, and write thorough unit tests for the edge cases before they show up in production.
Have a project in mind? Contact Sodio Technologies to discuss your requirements and explore the right technology solution for your business.
/// Work with us
Talk to the engineers who'd build it
You'll get a technical scope, timeline and cost estimate from the people doing the work, not an account manager. In-house team, no subcontracting, since 2016.
