This project has moved and is read-only. For the latest updates, please go here.

Custom number of control points

Jan 18, 2016 at 1:08 PM
Hello,

I'm using NShape for my bachelor degree work.

I'm trying to create circle shape only with 4 control points. I dont know which approach is better:
create own circle shape or edit current one.

Which methods and properties should I change?

Thanks for any answers.
Jan 21, 2016 at 8:00 AM
I would recommend to create your own shape library (see NShape Documentation, "NShapeLibraryInitializer class") and derive your shape from one of the Base classes in the Core assembly. Implement the HasControlPointCapability to define how the control points should behave (see NShape Documentation, "Programmer Tasks > Developing a New Shape Class > Defining the Control Points").
Marked as answer by Sourness on 1/25/2016 at 1:52 PM
Jan 22, 2016 at 12:49 PM
Thanks it's working now. But how can I forbid to connect for example Linear Sahpe to edge of circle .
Jan 22, 2016 at 1:54 PM
I assume you mean shape-to-shape connections (the line sticks to the shape itself instead to a control point)?
Adjust the ControlPointCapabilities of the ReferencePoint.
Jan 22, 2016 at 2:26 PM
Yes I mean point-to-shape connections. But now I don't know how should I adjust it. In HasControlPointCapability ?
Jan 25, 2016 at 12:21 PM
Yes, in HasControlPointCapability:
Adjust the ControlPointCapabilities of ControlPointIds.ReferencePoint.
Marked as answer by Sourness on 1/25/2016 at 1:52 PM