Creating guidelines from objects
Hi,
I just committed a change to SVN (rev. #17022) which allows the user to convert rectangles and 3D boxes to a collection of guidelines that are aligned along these objects' edges.
Originally, this was a stab at something in the direction of RFE #172136 (in particular, it was only meant to work for 3D boxes). But since I'm not familiar yet with grid infrastructure I thought that instead of a grid it would be easier to create a couple of guidelines from a box, which can then be used as a basis for 3D based drawings. Not as functional as a 3D box based grid but better than nothing.
Then it occurred to me that it may be even more useful to convert *rectangles* to guides because in this way it becomes much easier to create guidelines in specified positions/constellations (imagine applying it to rotated or skewed rectangles). So I implemented this as well and added an additional menu entry "Object->Objects to guides" which allows conversion to guidlines of any rects or 3D boxes in the current selection.
Now I have some questions.
1) I'm not sure if this kind of change should occur during Frost phase (I couldn't ask for an exception before because I hadn't thought of it at that time). But since IMHO it's an extremely useful yet very lightweight change - even if a couple of files were adapted - and I don't see any way in which this can possibly break things, I committed it anyway. If it is not desired and should be held back until after 0.46, please feel free to revert it.
2) Originally I added a button to the 3D box toolbar which allowed conversion of selected boxes to guides. After providing this option for rects, I also added this button to the rect toolbar, but then I thought it might also make sense in (at least) Selector tool, so I decided not to clutter the toolbars and removed the buttons altogether in favor of the menu entry. Do you think there is any value for such buttons?
3) I added the keyboard shortcut 'Shift+G' for conversion to guides in Rect, 3D Box and Selector tools. Do you think this is appropriate (I personally find it very handy to have a quickly accessible shortcut in these tools) or should there rather be a global shortcut associated with the corresponding verb? What would be an appropriate one?
Thanks, Max
P.S.: Release Notes will be updated in case this change is accepted for 0.46. BTW, I'm aware that I still need to update them for the 3D box tool and other things. Will do so as soon as possible.
Maximilian Albert wrote:
I just committed a change to SVN (rev. #17022) which allows the user to convert rectangles and 3D boxes to a collection of guidelines that are aligned along these objects' edges.
I can imagine that this would be useful for any object. Not to replace the object, but to create guides along the bbox of the current selection or the objects in the current selection. Of course this could be handled with some sort of dynamic guides or snapping too.
Great idea.
Aaron Spike
Great work Max! I like the idea, but haven't tried/seen it yet.
-----Original Message----- From: inkscape-devel-bounces@lists.sourceforge.net [mailto:inkscape-devel-bounces@lists.sourceforge.net] On Behalf Of Aaron Spike Sent: vrijdag 11 januari 2008 20:33 To: Maximilian Albert Cc: inkscape Subject: Re: [Inkscape-devel] Creating guidelines from objects
Maximilian Albert wrote:
I just committed a change to SVN (rev. #17022) which allows
the user
to convert rectangles and 3D boxes to a collection of
guidelines that
are aligned along these objects' edges.
I can imagine that this would be useful for any object. Not to replace the object, but to create guides along the bbox of the current selection or the objects in the current selection. Of course this could be handled with some sort of dynamic guides or snapping too.
Good idea Aaron, hope it's not too much work Max?
Cheers, Johan
J.B.C.Engelen@...1578... schrieb:
Great work Max! I like the idea, but haven't tried/seen it yet.
Thanks! But keep in mind that this was only possible because you enabled angled guidelines. :)
I can imagine that this would be useful for any object. Not to replace the object, but to create guides along the bbox of the current selection or the objects in the current selection. Of course this could be handled with some sort of dynamic guides or snapping too.
Good idea Aaron, hope it's not too much work Max?
Nope. Just wasn't sure if it's really useful. But since Aaron requested it, in current SVN the command "Object->Object to guides" converts _all_ objects in the selection to guides. As before, for rectangles and 3D boxes these guides are aligned along the edges. For all other objects, the guides are simply aligned along the borders of the bounding box. I made it so that the command recurses into groups (i.e., all objects are converted individually, regardless if they are grouped or not). Does this seem useful or should groups be treated as a whole?
As for the keyboard shortcut, I guess if we want to keep the above behaviour we should now go for a global one instead of having Shift+G enabled in Selector, Rectangle and 3D Box tools but nowhere else (or maybe we could keep Shift+G in Selector only). Suggestions are still welcome. How about Ctrl+Shift+I? (With some imagination the 'I' looks a bit like a Guideline, and 'i' also activates the command in the object menu).
Max
P.S.: Despite the positive feedback, my concern about Frost still applies. So if it's inappropriate, please roll back these changes.
On Jan 11, 2008 9:38 PM, Maximilian Albert <Anhalter42@...173...> wrote:
As for the keyboard shortcut, I guess if we want to keep the above behaviour we should now go for a global one instead of having Shift+G enabled in Selector, Rectangle and 3D Box tools but nowhere else (or maybe we could keep Shift+G in Selector only). Suggestions are still welcome. How about Ctrl+Shift+I? (With some imagination the 'I' looks a bit like a Guideline, and 'i' also activates the command in the object menu).
I like the feature but I don't think it really deserves a global shortcut. We don't have that many left :) A tool-specific one with Shift would be sufficient IMHO for those tools where this function can be conceivably used.
bulia byak schrieb:
On Jan 11, 2008 9:38 PM, Maximilian Albert <Anhalter42@...173...> wrote:
As for the keyboard shortcut, I guess if we want to keep the above behaviour we should now go for a global one instead of having Shift+G enabled in Selector, Rectangle and 3D Box tools but nowhere else (or maybe we could keep Shift+G in Selector only). Suggestions are still welcome. How about Ctrl+Shift+I? (With some imagination the 'I' looks a bit like a Guideline, and 'i' also activates the command in the object menu).
I like the feature but I don't think it really deserves a global shortcut. We don't have that many left :) A tool-specific one with Shift would be sufficient IMHO for those tools where this function can be conceivably used.
Alright. So I'm leaving Shift+G in Selector, Rectangle and 3D box tool. Or do you think all the shape tools should have it? How about Pen, Pencil and Calligraphy?
Max
On Jan 11, 2008 10:32 PM, Aaron Spike wrote:
I just committed a change to SVN (rev. #17022) which allows the user to convert rectangles and 3D boxes to a collection of guidelines that are aligned along these objects' edges.
I can imagine that this would be useful for any object. Not to replace the object, but to create guides along the bbox of the current selection or the objects in the current selection. Of course this could be handled with some sort of dynamic guides or snapping too.
I can imagine one day Inkscape will have a Guides Management dialog similar to Scribus's one that has exactly the feature Maximilian has implemented, only more flixible :)
Alexandre
I'm so lame, ... sorry Alexandre for the previous offlist message :),
So I copy/paste my text:
Is there a way to create a guide ligne from a straight line ? Apparently it's actually drawing them from its bounding box.
In anycase, this feature is really a must, good job!
Yann Papouin schrieb:
I'm so lame, ... sorry Alexandre for the previous offlist message :),
I'm no better ... :-) (sent this from the wrong email address so it was rejected)
Is there a way to create a guide ligne from a straight line ? Apparently it's actually drawing them from its bounding box.
Not yet, but as soon as I find the time it's one of the things right on top of my to-do list. I will, however, be very busy in the next week(s) so I can't promise when that will be. Might be tomorrow but might also be only in a month or so.
If anyone else is interested in implementing it and familiar with the SPPath/Nodepath code (which one would apply here?), it should be very easy to do. The relevant code for converting to guides is in sp-guide.cpp; just pass a list of Geom::Point pairs (one for each guide to create) to sp_guide_pt_pairs_to_guides(). See sp_rect_convert_to_guides() in sp-rect.cpp for an example of how to do it.
In anycase, this feature is really a must, good job!
Thanks. Glad to hear it's of use.
Max
Maximilian Albert wrote:
Is there a way to create a guide ligne from a straight line ? Apparently it's actually drawing them from its bounding box.
Not yet, but as soon as I find the time it's one of the things right on top of my to-do list. I will, however, be very busy in the next week(s) so I can't promise when that will be. Might be tomorrow but might also be only in a month or so.
Or even today. :)
Have fun using this. I hope it makes your editing more comfortable. The workflow for creating an angled guideline is now very simple:
1) Create a straight line segment in pen or pencil tool (and make sure it is selected) 2) Press Shift+G --> this converts the segment to a guideline
Note that when a whole path (or group of paths) is selected, all straight line segments in this path will be converted (but none of the curved segments, which would be a bit unintuitive).
Cheers, Max
P.S.: In case you want to keep the original path/object after converting to guides, there will soon be an option in Document Preferences ("Guides" tab) to control this behaviour.
P.P.S.: A million thanks again to Johan who implemented angled guidelines in the first place. Without his excellent work this would never have been so easy to achieve.
Although I've had grids not visible in my default template, new documents are showing the grid. In document settings, the checkbox is unmarked, I have to mark it then unmark it to get rid of the grid.
JF
Maximilian Albert schrieb:
P.S.: In case you want to keep the original path/object after converting to guides, there will soon be an option in Document Preferences ("Guides" tab) to control this behaviour.
Sorry, wrong. Since it's not a per-document option, this is of course not the right place for it. It can now be found in the "Tools" page of Inkscape preferences.
Max
Alexandre Prokoudine schrieb:
I can imagine one day Inkscape will have a Guides Management dialog similar to Scribus's one that has exactly the feature Maximilian has implemented, only more flixible :)
Since I'm not familiar with Scribus (yet), would you mind outlining in a few words what this dialog does? Alternatively you could file a RFE in Launchpad (if there isn't one yet).
Thanks, Max
On Jan 15, 2008 11:40 PM, Maximilian Albert de> wrote:
I can imagine one day Inkscape will have a Guides Management dialog similar to Scribus's one that has exactly the feature Maximilian has implemented, only more flixible :)
Since I'm not familiar with Scribus (yet), would you mind outlining in a few words what this dialog does? Alternatively you could file a RFE in Launchpad (if there isn't one yet).
Sure thing :)
Basically it's a floating palette with three tabs:
The first tab is all about fast editing of each horizontal/vertical guides (Scribus has no angled guides, yet), adding new and deleting existing ones. It's just two listboxes, each has an add/delete set of buttons.
The second tab is about creating new guides in rows/columns with relation to either page, margins or selection (which is why it's a floating palette ;-)). Say, you have a text frame and you want 5 vertical and 3 horizontal guides from it. You select the frame, fire up the Guides Manager, define amount of guides in each dimension and justy press Enter. You can optionally create gaps between guides which will, in fact, double defined amount of guides.
The third tab provides two buttons to delete all guides from current page and all pages.
Alexandre
On Jan 11, 2008 10:04 PM, Maximilian Albert wrote:
Hi,
I just committed a change to SVN (rev. #17022) which allows the user to convert rectangles and 3D boxes to a collection of guidelines that are aligned along these objects' edges.
Please note that upper horizontal guideline always has angle 180 degrees by default instead of 0 (bottom horizontal guideline is 0 as expected). Would be nice to have it fixed ;-)
Alexandre
Alexandre Prokoudine wrote:
Please note that upper horizontal guideline always has angle 180 degrees by default instead of 0 (bottom horizontal guideline is 0 as expected). Would be nice to have it fixed ;-)
Done. But does it really have a practical significance?
While I was at it I also changed the angle of the second vertical guideline from 90 to -90 so that "vertical guideline" is displayed in the status bar and dialog. Does this make sense or would you prefer a positive angle throughout?
BTW, for horizontal guides having the "wrong orientation", Inkscape displays an angle of "-180" in the status bar and topmost line of the guideline dialog whereas the angle in the entry field is correclty computed as 0 degrees. It would perhaps make sense to adapt this, too.
Max
On Feb 10, 2008 4:36 AM, Maximilian Albert wrote:
Alexandre Prokoudine wrote:
Please note that upper horizontal guideline always has angle 180 degrees by default instead of 0 (bottom horizontal guideline is 0 as expected). Would be nice to have it fixed ;-)
Done. But does it really have a practical significance?
Well, it was kind of weird to see both -180 and 0 used in same dialog, knowing that a parallel horizontal guideline is at just 0 degrees ;-)
While I was at it I also changed the angle of the second vertical guideline from 90 to -90 so that "vertical guideline" is displayed in the status bar and dialog. Does this make sense or would you prefer a positive angle throughout?
It does makes sense, for consistency's sake ;-)
BTW, for horizontal guides having the "wrong orientation", Inkscape displays an angle of "-180" in the status bar and topmost line of the guideline dialog whereas the angle in the entry field is correclty computed as 0 degrees. It would perhaps make sense to adapt this, too.
I agree :-)
Alexandre
participants (7)
-
unknown@example.com
-
Aaron Spike
-
Alexandre Prokoudine
-
bulia byak
-
Joshua Facemyer / Impressus Art
-
Maximilian Albert
-
Yann Papouin