opendesigndev / octopus-specs

Octopus format specification (OpenAPI)
https://main.d215pdpdn4c7ow.amplifyapp.com/
2 stars 3 forks source link

Shape geometry format #2

Open scoiatael opened 1 year ago

scoiatael commented 1 year ago

In GitLab by @janroztocil on Nov 23, 2018, 15:36

Shape Geometry Format

Motivation

There is an opportunity to encode shape geometry differently, like having normalized coordinates that are relative to the shape.bounds instead of absolute in an artboard. That would allow to easily scale shapes or place them from one octopus to another.

Tasks

Notes

If we preserve current state, i.e. position of every point (actual or control) is encoded in absolute artboard coordinate system, bounds in this case are only auxiliary since they can be computed from the geometry itself.

If redesigned, each coordinate would be number in [0;1] and would denote a position relative to the shape's bounding box. bounds object would be required for each shape in this case.

The advantages of this approach are compactness (same numbers are not repeated) and possibility of automatic scaling. Only bounds need to be adjusted and layer can be dropped somewhere (that's symbols master instantiation for example). Yea, there's also the constrains logic, so it's not automatic win anyway.

scoiatael commented 1 year ago

In GitLab by @rychlis on Jun 25, 2019, 15:01

expander already uses similar relative [0;1] format internally

scoiatael commented 1 year ago

In GitLab by @rychlis on Oct 3, 2019, 13:11

mentioned in issue backend#1633