Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #197

Open
vfailla opened this issue Oct 11, 2017 · 6 comments
Open

Documentation #197

vfailla opened this issue Oct 11, 2017 · 6 comments
Assignees
Labels
epic Large task that can be broken down into a number of issues
Milestone

Comments

@vfailla
Copy link

vfailla commented Oct 11, 2017

Hello Exyte team,
first of all I want to thank you all for this marvelous framework.
I'm developing a 2D CAD application for iPad and I decided to base it on Macaw.
Of course it seems Macaw have not been created explicitly for such a purpose (2D CAD) and so I'm going to implement all of the required core features to make Macaw work as a CAD framework.
For such a reason some documentation, even generic and "beta", could be very helpful, just to avoid reinventing the wheel: the main topics I'm interested in are, of course, Nodes, Paths and Arcs.
Moreover I feel like I'm missing some important features that could make my work easier.
As you surely understand, reverse engineering needs a lot of time (I'm still trying to better understand all of PathSegmentTypes! LOL), thus every documentation will be really appreciated.

Thank you in advance and congratulation for your great work.
Enzo

@kayuri
Copy link
Collaborator

kayuri commented Oct 12, 2017

@vfailla Thanks a lot for your feedback! We will try do our best to add more topics to Macaw documentation. Could you please let us know what kind of important features do you miss most at the moment?

@kayuri
Copy link
Collaborator

kayuri commented Oct 13, 2017

@vfailla Btw, have you checked out our posts on Macaw? If not yet, would definitely recommend you to take a look at them too:

@vfailla
Copy link
Author

vfailla commented Oct 16, 2017

Hi @kayuri, thank you for your fast and kind reply.
See below some of the core features that would be very helpful in a CAD-drawing context.
Please, consider that I'm aware that my assumptions concerning how Macaw works could be totally wrong.

The first thing that would be great to have, is the ability of creating a Path where the same vertex can be connected to multiple vertices.
In other words, thinking a Path as a graph it would be very useful the ability to have nodes with degree greater than 2, while, as of now, every node of such a graph has degree 2 at most(i.e. one edge in input and one in output).

In the attached image it is shown a three-steps process:

  • Step 1: a Path is created
  • Step 2: one of the vertices of the Path has been selected (in red)
  • Step 3: the selected vertex has been removed

path

Below each step I reported both the Segment.data field and the PathSegmentType.
Consider the selected vertex (the red one) has coordinates [600.0, 300.0].
To simulate the diagonal line starting from this vertex, I have created the following segments:

  • [600.0, 300.0] PathSegmentType: M
  • [300.0, 500.0] PathSegmentType: L

Thus, the Point with coordinates [600.0, 300.0] is repeated twice (see in the image the path segment list, Step01)

As soon as I want to remove such a point from the drawing, I have to remove all of its occurrences from path segment list: it's possible and it also works, as you can see in step 3.
The drawback is that this workflow can produce duplications of lines and vertices.
In Step 3 is shown the final configuration of the Macaw Path, after the removal of the red vertex: all of the three vertices are duplicated.

This behavior is totally logical and could be avoided only if I have the possibility to use the same segment (i.e. [600.0, 300.0]) to originate multiple lines.

An alternative could be to perform a sort of "purge" operation on the Path to remove all of the redundant segments... but the algorithm is not obvious and, moreover, I'm not so sure about performances.

Another minor topic concerns the ability of adding more gestures (2-fingers tap, long pressure...) to a Locus (f.e. Path). This would be useful to allow the user to perform specific operation on a selected object.
Moreover, if the thickness of a line is small (that is reasonable for a CAD app), tapping exactly on a line is tricky... a sort of neighbourhood of the touched point should be evaluated for the hit testing.

Finally it would be even greater if I find a simple way to convert a Macaw node to DXF Autocad format... but this is too much of course! LOL

I will appreciate any suggestion concerning the above mentioned topics.

Thank you,
Enzo

@kayuri kayuri self-assigned this Oct 23, 2017
@kayuri
Copy link
Collaborator

kayuri commented Oct 23, 2017

Hi @vfailla, apologize for my late reply. Discussed with team here and we think you can easily achieve it with a reasonably thin additional layer of vertices and edges. So, you you will have a set of vertices and set of edges which connect them. As soon as you will want to remove vertices you just remove it from the set and this will remove all the incoming or outgoing edges from your drawing. Edges and vertices thus will be represented as paths in Macaw's model, but edges/vertex management will be purely on user's/client's side.

@kayuri
Copy link
Collaborator

kayuri commented Oct 23, 2017

Another minor topic concerns the ability of adding more gestures (2-fingers tap, 
long pressure...) to a Locus (f.e. Path). This would be useful to allow the user to 
perform specific operation on a selected object.

Yep, we will tackle this at some point. Can't tell when exactly at this moment but will get back to you soon.

Moreover, if the thickness of a line is small (that is reasonable for a CAD app), 
tapping exactly on a  line is tricky... a sort of neighbourhood of the touched point 
should be evaluated for the hit testing.

At the moment you can use the following workaround to tackle this problem: add thicker transparent line and attach actions this transparent line instead.

@vfailla
Copy link
Author

vfailla commented Nov 3, 2017

Hi again @kayuri, thank you for your suggestions that worked very well.
I also implemented a sort of "purge" method to remove duplicated PathSegments and "orphan" M points... it's still in testing.

Another boring issue I experienced is related to Node class (or to its parent class "Drawable").
What I would like to reach is the ability of saving the "scene" object, i.e. the node member of a MacawView.
That would be useful for two purposes: saving a drawing project and performing some undo/redo operations.
Unfortunately it seems that the Node class does not implement the NSCopying protocol (and the NSCoding one) and, moreover, I didn't find any direct way to make a deep copy of a given node.

For example if I have:

let sceneOriginal : Node = Node(....)
let sceneCopy : Node = sceneOriginal

then as soon as I change sceneOriginal, of course, sceneCopy will change as well.

Thus I'm wondering whether a method already exists to perform a deep copy of a Node.

Thank you in advance again.

@ystrot ystrot added this to the 0.9.3 milestone Jun 28, 2018
@ystrot ystrot modified the milestones: 0.9.3, 0.9.4 Oct 2, 2018
@ystrot ystrot added the epic Large task that can be broken down into a number of issues label Feb 6, 2019
@ystrot ystrot modified the milestones: 0.9.4, 0.9.x Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Large task that can be broken down into a number of issues
Projects
None yet
Development

No branches or pull requests

3 participants