Hi again.
I know it's been a while since I did anything relating to this, I've been a little distracted. I've been trying to fix the issues that were pointed out before, this is the bug when converting a circle to a path and the lack of sensible conversion from an arc to a bezier.
Before I go any further however, I'd like to update the the latest code from upstream but I'm not sure how to do this with bzr. If I was using git then I would now run 'git pull --rebase' and fix any conflicts that have appeared. How do I do the same with bzr?
Assuming that goes well, I also need a little help adding the feature for converting from an arc to a bezier. I have the following code which runs when doing such a conversion, it generates a bezier path to insert where the arc was, but I'm not sure how to insert that new path in place of the old segment. Below is an extract from my src/ui/tool/path-manipulator.cpp, see the 'TODO' comment...
Thanks for any guidance. Dan.
/** Make selected segments curves / lines / arcs. */ void PathManipulator::setSegmentType(SegmentType type) { if (_num_selected == 0) return; for (SubpathList::iterator i = _subpaths.begin(); i != _subpaths.end(); ++i) { for (NodeList::iterator j = (*i)->begin(); j != (*i)->end(); ++j) { NodeList::iterator k = j.next(); if (!(k && j->selected() && k->selected())) continue; switch (type) { case SEGMENT_STRAIGHT: if ((j->front()->isDegenerate() && k->back()->isDegenerate()) && (j->arc_rx()->isDegenerate() && j->arc_ry()->isDegenerate())) break; j->front()->move(*j); k->back()->move(*k); j->retractArcHandles(); break; case SEGMENT_CUBIC_BEZIER: printf("To cubic bezier!\n");
if (!j->front()->isDegenerate() || !k->back()->isDegenerate()){ break; } if (!j->arc_rx()->isDegenerate() || !j->arc_ry()->isDegenerate()){ // This is an elliptical arc that is being converted to a cubic bezier Geom::Path cubicbezier_path = Geom::cubicbezierpath_from_sbasis(j->getEllipticalArc().toSBasis(), 0.1); printf("Size of path to insert: %lu\n", cubicbezier_path.size()); // ====== TODO ====== // How do I now get the contents of cubicbezier_path to // replace this arc segment?? // ==================== break; }
// move both handles to 1/3 of the line j->front()->move(j->position() + (k->position() - j->position()) / 3); k->back()->move(k->position() + (j->position() - k->position()) / 3); j->arc_rx()->move(*j); j->arc_ry()->move(*j); j->retractArcHandles(); break; case SEGMENT_ELIPTICAL_ARC: if (!(j->front()->isDegenerate() && k->back()->isDegenerate())){ j->front()->move(*j); k->back()->move(*k); }
if (j->arc_rx()->isDegenerate() && j->arc_ry()->isDegenerate()){ Geom::Point midPointOffset = ((k->position() - j->position()) / 2); Geom::Point handleOrigin = j->position()+midPointOffset;
j->arc_rx()->setOffset(midPointOffset); j->arc_ry()->setOffset(midPointOffset); j->arc_rx()->move(j->position() + ((k->position() - handleOrigin) / 2)); j->updateArcHandleConstriants(j->arc_rx()); } break; } } } } --------- Original Message --------- Subject: Re: [Inkscape-devel] Arcs in the path editor - be kind to new users. From: "John Billingsley" <john@...3371...> Date: 5/22/16 4:07 pm To: inkscape-devel@lists.sourceforge.net
I see some fascinating developments here - but many of them will baffle users who are new to Inkscape. I see below a mention that the toolbox bar is getting crowded and can sympathise strongly with that.
The first question of a new artist user is likely to be "Can the software see my pressure-sensitive pen?" Then "How can I scribble a quick sketch as easily as in OneNote?" Only when they gain confidence in the program will they look for the bells and whistles, such as node editing, brush texture, cloning, mirroring, morphing .....
I would recommend a 'first launch' distribution that shows a minimal number of tools on the tool bar, one of which could be 'add tool', so that the user can tiptoe into the more advanced options rather than being plunged in from the start. I would also recommend a diagnostic feature to show whether the pressure tablet is really seen. The tablet driver can produce two conflicting pairs of coordinates and that is another source of confusion. (You might like to see a minimal diagnostic at www.jollies.com/drawpressure.htm - though it only works with IE)
I look forward with interest to the launch of version 0.92,
Best wishes John
On 17/05/2016 00:20, Martin Owens wrote: Dear Dan,
Welcome and thank you for your help.
I've had a look at the code, it looks very reasonable for what I think the feature does. It would be great if you could make a short video showing the feature (you don't have to), I've found it easier to review new features with their ui and code with a video demonstration.
The one thing I did spot was the creation of some toolbox items, there's a lot of icons on that bar now and we might be weighing it down. but I'll know more when I can see it in the flesh.
Best Regards, Martin Owens
On Mon, 2016-05-16 at 02:37 -0700, d@...3396... wrote: Hi, I've not contributed to inkscape before, this is my first time. I have created a branch which supports editing elliptical arcs in the node editor. I'm new to bazaar (and inexperienced with launchpad) so I think I've done the right thing with a merge request here: https://code.launchpad.net/~danieljabailey/inkscape/arc_node_editor/+ merge/294742 (but thought I'd check by asking on this list.) Is this an interesting feature? If so I can polish it up for merging into the main repo. Thanks. Dan.
------------------------------------------------------------------- ----------- Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j____________________... Inkscape-devel mailing list Inkscape-devel@...575....sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel