# YAPPgenerator API

All objects (cutouts, pcbStands, labels) are entered as elements in an array. Each element is an array of its own. The way you populate the array's is named the '*YAPPgenerator API*', **`API`** for short.

In the description of the API we use the following convention:

Parameters\
&#x20;         p(..)   means it is a **Positional** parameter like. These \
&#x20;                 parameters must be entered in *fixed order*.\
&#x20;         n(..)   means it is a a **non-Positional** parameter. These\
&#x20;                 parameters can be entered in *random order*.\
\
There are **required** parameters (you need to enter all required parameters) and **optional** parameters (they mostly have a default value and can be omitted).

For non-numerical parameters the following syntax is used:

```
   { yappKeyWord }
   <Default value>
   | means one or more values from the list are allowed
   , means only one value from the list is allowed
```

To elaborate lets use a fictional *demoArray* with this API:

```
demoArray Parameters:
 Required:
  p(0)  = posx                    --\
  p(1)  = posy                      > required positional parameters (0),(1) and (2)
  p(2)  = { yappThis | yappThat } --/
  
 Optional:                                                   
  p(3)  = standoffDiameter    Default = standoffDiameter;        --\
  p(4)  = standoffPinDiameter Default = standoffPinDiameter;       > Optional
  p(5)  = standoffHoleSlack   Default = standoffHoleSlack;       --/    Positional

  n(a)  = { <yappBoth> | yappLidOnly | yappBaseOnly }            --\
  n(b)  = { <yappPin>, yappHole } // Baseplate support treatment   |
  n(c)  = { <yappAllCorners> | yappFrontLeft | yappFrontRight      > Optional, non-
                             | yappBackLeft | yappBackRight }      |  Positional
  n(d)  = { <yappCoordPCB> | yappCoordBox | yappCoordBoxInside }   |
  n(e)  = { yappNoFillet }                                       --/
```

As you can see, there are three required positional parameters p(0, 1 and 2) and there are three optional positional parameters p(3, 4 and 5).\
Not all `positional` parameters are required but if you want to give f.i. positional parameter p(5) a value of '50' you also have to enter values for optional parameters p(3) and p(4). This might look like this:

```
  +---+-----+----< required parameters p(0), p(1) and p(2)
  |   |     |
  V   V     V
[10, 13, yappThat, yappDefault, yappDefault, 50 ...]
                       ^            ^         ^  
                       |            |         | 
                       |            |         \---> new value for positional 
                       |            |                 parameter p(5)
                       |            \------------> positional/required parameter p(4)
                       \-------------------> positional/required parameter p(3)                     
```

The following entries are all valid:&#x20;

```
demoArray = 
[
  [5, 6, yappThis]                    //-> Parameters 0, 1 and 2 are given, the rest
                                      //   are optional with default values.
  [5, 6, yappThis, yappDefault, 2]    //-> Same as previous entry, but with a value 
                                      //   of '3' for parameter 4.
  [5, 6, yappThis, yappDefault, yappDefault, 0.5] //-> Same as the first entry, but 
                                                  //   a value of 0.5 for
                                                  //   parameter 5.
  [5, 6, yappThis, yappDefault, 2, 0.5] //-> Same as the first entry, but with a value
                                        //   of '2' for parameter 4 and 
                                        //   a value of '0.5' for parameter 5.
  [5, 6, yappThis, 8, 2, 0.5]     //-> Same as the first entry, but with a value
                                  //   of '8' for parameter 3 and a value of '2'
                                  //   for parameter 4 and a value of '0.5' for
                                  //   parameter 5.
  ];
```

Parameter **n(a)** can have the values (one or more) *yappBoth*, *yappLidOnly* and/or *yappBaseOnly*. If neither is given, the default *yappBoth* will be used.

Parameter **n(b)** can have one (and only one) of the values *yappHole* or *yappPin*. If omited the default value *yappPin* will be used.

Parameter **n(c)** can have one or more values *yappAllCorners*, *yappRightLeft*, *yappFrontRight*, *yappBackLeft* and/or *yappBackRight*. If omitted *yappAllCorners* will be used.

Parameter **n(d)** can have one of the following values *yappCoordBox* or **yappCoordPCB**. If omitted *yappCoordPCB* is used.

Parameter **n(e)** can have the value *yappNoFillet*. If omitted the default is that for this object fillets are created.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mrwheel-docs.gitbook.io/yappgenerator_en/yappgenerator-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
