Set Up the Behaviors through API
The behaviors of the product in the kitchen planner are defined via behavior attributes.
➡️ For complete specification of behavior fields, please refer to the route POST products/ in the API.
"behaviors": {
"targetPositionID": 1,
"openingShapeID": 1,
"defaultAltitude": 0,
"manipMode": 1,
"ungroupable": true,
"collision": {
"collide": 0
},
"modular": true,
"replaceable": true
},
targetPositionID
Key | Value type | Possible values |
---|---|---|
targetPositionID | integer | [1,2,4,8,16,32,64] |
The target position defines where the product will be inserted and/or manipulated in the kitchen plan. The value must be one of the following integers or a sum of those for combined behaviors:
- 1: onFloor - inserted on floor and cannot be elevated
- 2: onWall - inserted on a wall - see next paragraph to define default altitude - and snaps on vertical surfaces during translation
- 4: free - snaps on horizontal surfaces during translation
- 8: onSlopedWall - inserted on a sloped wall. For instance for specific openings
- 16: onCeiling - inserted on ceiling. For instance ceiling lamp or hood for kitchen island
- 32: onCornerLeft - snap-rotates in room corners during translation. Use 'Left' if product's 3D model has one back on Y axis and another on X axis (cf. Fig.1)
- 64: onCornerRight - snap-rotates in room corners during translation. Use 'Right' if product's 3D model has one back on Y axis and another on -X axis (cf. Fig.1)
Fig.1: Top view of a right and a left corner products
The options onCornerLeft and onCornerRight may be combined with other target positions. For instance, set the value 65 for a right corner product that should stay on floor. Note: if onCornerLeft and onCornerRight are combined (with the value 96) then only onCornerLeft will be applied. The other options are exclusive and should not be used simultaneously. If several are set then no behavior will be applied.
📌 Note that the target position atttribute is also used for: ▪️ Defining whether the product will be placed on the wall (value
onWall
) or on a sloped wall (valueonSlopeWall
); ▪️ Performing specific checks via the ceiling applicative rules (valueonCeiling
).
The Applicative Rule PositionOfCeilingMountedFurniture
🔗 is triggered only by furniture having the key/value pair "targetPositionID": 16
(i.e. onCeiling
), knowing that onCeilling
can be set on all typeIDs.
Other typeIDs like BaseCabinets
or Fridges
now have their own predefined behavior and do not need any targetPositionID
(the value will be ignored).
📌 Note that
openingShapeID
is also intended for openings (to define the shape of the hole that the opening will create in the wall) and is useless for furniture.
defaultAltitude
Key | Value type | Possible values |
---|---|---|
defaultAltitude | number | [0 ;∞] |
This is the default altitude of the product, i.e. the height from the floor expressed in millimeters, that is used when inserting the product into the project. The bottom of the bounding box is considered to compute the distance.
This altitude is taken into account to distinguish corner base cabinets from corner wall cabinets: if the defaultAltitude
> 0, then it is a corner wall cabinet.
manipMode
This attribute defines which manipulation mode(s) will be available on the product in the kitchen planner. The value is a bitmask of possible values:
- 1: Translate
- 2: Rotate
- 4: Elevate
For example to allow all the manipulation modes on a product, specify 7 as the value for manipMode
because 1 + 2 + 4 = 7.
📌 Recommendation: Do not apply "Elevate" on base cabinets as they are intended to remain on the ground. This will help to prevent planning errors and simplify the UI for the user.
ungroupable
Key | Value type | Possible values |
---|---|---|
ungroupable | boolean | [false,true] |
- false: The grouped set of products are not ungroupable.
- true: The grouped set of products are ungroupable.
The default is false
.
collision
Collision is an object with only one possible key: collide
. It applies only for the manipulation mode "translate".
Key | Value type | Possible values |
---|---|---|
collide | boolean | [0,1] |
- 0: The product bounding box does not contribute to the collision scene. When manipulated, the product will only snap but not collide with the collision scene.
- 1: The product bounding box contributes to the collision scene. When manipulated, the product will collide with the collision scene (based on its bounding box).
📌 "collision" means that objects cannot merge into each other (hard objects) unlike to a "non-collision" where objects can be placed into each other (soft objects like decoration objects).
modular
Key | Value type | Possible values |
---|---|---|
modular | boolean | [false,true] |
- false: The product cannot be composed in the cabinet configurator.
- true: The product can be composed in the cabinet configurator.
The default is true
, meaning the product can be composed in the cabinet configurator.
📌 Fillers cannot be composed in the cabinet configurator. Fillers have the closed tags
FillerStrips
,FreeStandingFillerStrips
orFillerStripAngle
.
replaceable
Key | Value type | Possible values |
---|---|---|
replaceable | boolean | [false,true] |
- false: The product will not be replaceable.
- true: The product will be replaceable.
The default is true
, meaning the product will be replaceable.