Skip to main content

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​

KeyValue typePossible values
targetPositionIDinteger[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)

CornerProducts 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 (value onSlopeWall); β–ͺ️ Performing specific checks via the ceiling applicative rules (value onCeiling).

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​

KeyValue typePossible values
defaultAltitudenumber[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​

KeyValue typePossible values
ungroupableboolean[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".

KeyValue typePossible values
collideboolean[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​

KeyValue typePossible values
modularboolean[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 or FillerStripAngle.


replaceable​

KeyValue typePossible values
replaceableboolean[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.