Light switch configurator

Hey everyone :slight_smile:

Working on a “new” configurator. It already exists using Solidworks Sell, but we want to make something that works faster and more flexible in its rendering abilities, also easier to manage as a whole.

(I’ve already quickly talked about it here : 3D configurator)

Left: SW Sell , Right: PlayCanvas demo

Problems with Solidworks Sell

I will have X amount of different plate sizes, X amount of possible component placements, and right now it’s hard to manage in SW Sell, as you have to make a model for each plate, and configure each placement by adding each possible component etc… The result is that I have a ton of models in SWSell, and each time you need to change something, you have to change it EVERYWHERE!

Each plate size + possible placements becomes a project in SWSell, and I have hundreds of them now

A pain in the *** :angry:
If I can manage to make the holes in realtime (see below), I’ll be able to have only plate per size.

Also the rendering is a bit limited, you can’t really set your UV maps as you want, can’t really play around with lights, skyboxes/cubemaps etc… This configurator is primarly used for a commercial use, so the “Wow!” factor has to be high !

Problems with the 3D models

My biggest problem hasn’t anything to do with PlayCanvas : Going from a SolidWorks model which are volumes, to something like OBJ or FBX which are surfaces, is always resulting in a giant mess, and remeshing is never working !

I might have to find someone skilled enough to remake these models in blender :sweat_smile: This is way out of my league.

Making holes

On PlayCanvas side, my main challenge is making holes in a plate :muscle:
I tried this technique : Stencil Buffer - 3D Magic Card | Learn PlayCanvas

And It kind of works well : Switch Demo - Forum 1 - PLAYCANVAS
You can right-click on one of the 3 positions in order to show a component.
Right now it rotates a list of components, this is just for a demo :slight_smile:

The problem is that it shows that there is no volume in the plate, so I also added a mesh simulating a “cut” in the plate.

That’s it for now ! :slight_smile:


I haven’t played around with collisions yet !
But I would like to detect collisions between two components in order to avoid this.
In SW Sell, I’ve hacked together a system allowing to detect this (using coords etc…), but if I can use PlayCanvas’ collision system that would be great!

Should I look into this? Can I detect a collision even if there are no movements?

Hi @TonyLGC,

Yes, you can do that. You have two main options depending on the accuracy you are looking for:

  1. Use the BoundingBox / OrientBox classes to setup collision boxes which you can subsequently use to detect intersections.

  1. If you are looking for more accuracy you will have to use physics. That allows you to use a mesh collider for your rigid bodies. But if you are looking to detect mesh to mesh collisions sadly that isn’t supported, only mesh to everything else (box, sphere etc.).

One good way to increase precision is to use compound objects. That allows you to use a combination of primitive collision shapes to achieve for complex colliders. Check this example:


Thank @Leonidas !
BoundingBoxes seem took do perfectly the trick, this is accurate enough :wink:


These topics helped me :


Love this workaround for the stencil work, that’s a great idea!