1
0
Fork 0
freesewing/markdown/dev/reference/macros/ringsector/en.md
Joost De Cock 075cb34184 feat(plugin-ringsector): New plugin to draft a ring sector
This plugin provides the `ringsector` and `rmringsector` plugins.

The Sandy design was adapted to use the `ringsector` plugin instead of
its own method for doing this (that method was the base for this
plugin).

The plugin is also added to the tabbed-example component.

This closes #3865
2023-10-16 16:19:27 +02:00

2.5 KiB

title
ringsector

The ringsector macro drafts a ring sector, which is like a part of a donut with an inside and outside radius. It is particularly useful for drafting curved waistbands, circle skirts, and so on.

It is provided by the ringsector plugin.

##### Not a core-plugins macro

The ringsector macro is not provided by the core-plugins, so you need to load the ringsector plugin explicitly if you want to use it.

Signature

macro('ringsector', {
  Point center = new Point(0,0),
  Number angle,
  Number insideRadius,
  Number outsideRadius,
  Boolean rotate = false,
  String id='ringsector',
})

Example

```js ({ Point, macro, Path, paths, part }) => {

macro('ringsector', { angle: 60, insideRadius: 30, outsideRadius: 45, })

return part }

</Example>

## Configuration

| Property       | Default           | Type                | Description |
|---------------:|-------------------|------------|-------------|
| `center`       | `new Point(0,0)`  | [Point][1] | The center point of the ring sector |
| `angle`        |                   | Number     | The angle the ring sector should cover |
| `insideRadius` |                   | Number     | The inside radius of the ring sector |
| `outsideRadius` |                  | Number     | The outside radius of the ring sector |
| `rotate`       | `false`           | Boolean    | Whether or not to rotate the ringsector so one of its sides is vertical (see [example below](#example-when-rotatetrue)) |
| `id`           | `ringsector`      | String     | The id to use in auto-generate macro points and paths |

[1]: /reference/api/point

## Notes

### Nodes generated by this macro

This macro will add points and a single path to your part.
Their IDs will be saved in store under:
`parts.{part.name}.macros.@freesewing/plugin-ringsector.ids.{id}`

### Removing a ring sector

If you inherit a part with a ring sector drafted by this macro and you'd like to remove it,

you can do so with [the rmringsector macro](/reference/macros/rmringsector).
### Example when rotate=true

<Example caption="Example of a ring sector drafted by this macro when rotate is truthy">
```js
({ Point, macro, Path, paths, part }) => {

  macro('ringsector', {
    angle: 60,
    insideRadius: 30,
    outsideRadius: 45,
    rotate: true,
  })

  return part
}