I know how to use alignment/distribution with inkscape.
But they only work once. It does not persist.
Example:
As soon as I change the size of one of the objects, and the alignment gets lost.
Is there a way to persist the alignment?
Example: If I change the size of the circle, its center should still be centered.
If Inkscape can't do that. Is there an other tool which can do this?
There is no such thing as persistent alignment in Inkscape AFAIK.
One thing you can do is resize objects around their center (holding shift while resizing).
Another option (my preferred) is to enable snapping to midpoints, centers of objects and centers of rotation, and to use guides. This way you can quickly snap objects back in place after modification.
Your question relates to the more general issue of
transformation anchors, regardless of whether there are alignment requirements or not.
The currently available simple method, holding shift while resizing, always uses the center of the object as the anchor, which may or may not be what you want (in your example, you may want to keep centered alignment in the vertical direction, but left alignment for each object in the horizontal direction).
There is a proposal for selecting the transformation anchor.
As per official documentation, The anchors let you decide the transformation center to use when entering a numerical value for a transformation (let it be from the toolbar or in the Object->Transform... dialog).
The interface would let you select the center for the transformation. Then, you would have 3 (vertical) x 3 (horizontal) = 9 possible anchors.
AFAIK, this is not available yet.
In order to change the size of any vectorial component and persist its transformation center you have three options:
holding shift + mouse drag (will perform symmetric transformation)
holding shift + ctrl (will scale but keeping the same aspect ratio)
holding shift + ctrl + alt (will scale upwards/downwards by twice/half the size && keeping the same ratio)
Related
I am using Inkscape to make a template SVG which I extract out the rect coordinates to use for my own drawing program.
I've noticed that Inkscape, when in landscape mode, adds a translate(0,-308.2677) to the group g element and then each rectangle rect element has a corresponding translate(0,308.2677).
My guess is that this is added (in A4 mode 308 is 'height - width' in portrait) in order to move the origin from top left to bottom left. So when a user of Inkscape swaps back and forth from landscape and portrait the bottom left is fixed with all items relative to that.
To me this seems a bit strange as Inkscape is an SVG tool and coords in SVG are top left growing x to the right, and y down.
My question is can I turn this off to force Inkscape to keep the origin at top left and not to dirty the SVG with extra translates?
Bonus: why does Inkscape do this? It is just aesthetics with the assumption that most people are Cartesian or is there a good programming reason for this?
thanks,
LB
is there a good programming reason for this
No. Not really. It dates back to the very early days of computer graphics and memory-mapped screen buffers. (0,0) was at the top left because that was the lowest memory location.
As time went on, that became the default origin position for most (but not all) computer OSs and graphics formats. And I am confident that was why the original SVG authors choose that arrangement also.
I suspect, as you do, that the Inkscape authors probably chose the normal cartesian bottom-left position because they though that would be more familiar to users. They are not unique among vector editing software.
I am beginner in modelling. Can I increase object's polygen in 3dsmax? I want have smooth object that have not low polygens.
You can increase the polygon count of you model so many ways:
Use subdivide modifier.
Use the turbo smooth modifier.
Use tessellate modifier.
You can use TurboSmooth modifier for this purpose, but before use it, you should make sure your model have enough edges and check if the edges are correct. for example, make sure your vertex not connect to odd number edges( like 3 or 5 edges ) always try to keep it in even numbers, 4 edges is standard, check image below :
both of them used odd numbers ( 3 and 5 ) which is not correct.
try to add more edges to your model and Chamfer them if necessery, before applying turbosmooth or other smooth Modifier's.
You can smooth it by adding a smooth or turbo smooth modifier, then convert it to polygon edit again - or collapse the object class from modify tab - this will reproduce polygon evenly all over the object faces.
Alternately you can select a ring or loop of faces then use the connect tool to add more resolution (polygons) to these selected polygons only
As for the fish model in your image, you can select one of the height faces, then from the polygon edit section in the modify panel on the right, click ring it'll select all the height faces all around the fish, then scroll down on the modify panel click on connect and set the number to add more resolution
UPDATE:
Please take in consideration that there's nothing like infinite segments even spheres (balls) or cylinders in 3D just have a higher number of segments - usually 32+), you can double or triple it but not more, increasing objects segments for very high values can bring your computer down to its knees while modeling or rendering
New versions of 3dsmax (2015, 2016) have a new subdivision modifier called OpenSubDiv modifier. This can be used to subdivide your model, and give it more polygons. There is also the Turbosmooth, Meshsmooth, Tessellate, and Subdivide modifiers available. All of these will add more geometry to your model, based on different algorithms.
I want to add zoom capability to an app, which at its core is a spf graph app. Now I currently have no zoom, but the ability to select/move, multi-select objects on the graph in the graph window. I started to write my own code to do scaling of the objects and then work out mouse co-ordinates to map clicks and redraws correctly. I didnt complete this as I found the Gdiplus::SetPageScale function, which scales the window fine but I cannot see any GDI function I can use to map the mouse click co-ordinates from the world co-ord's to the page co-ords. I tried TransformPoints(Gdiplus::CoordinateSpaceWorld, ::Gdiplus::CoordinateSpacePage, points, 2) but this does not convert the points and the returned points are (0,0).
So is this even possible with Gdiplus or do I need to write this mapping myself? Any advice appreciated!
You don't want to use Graphics::SetPageScale() in this case. The much more general way is to use the Matrix class instead. Its Scale, Translate and Rotate methods are handy to get the matrix you need. You'll want to use the Scale() method here, possibly Translate() to change the origin.
Before you start drawing, activate the matrix with the Graphics::SetTransform() method. Anything you draw will now automatically be scaled according to the arguments you passed to the Matrix::Scale() method. Mapping a mouse position is now exceedingly simple with Matrix::TransformPoints() method, the exact same transform that was used while drawing is now applied to the mouse coordinates. Even going back from graph coordinates to mouse coordinates is simple, use the Matrix::Invert() method to obtain the inverse transform.
When GDI+ draws, it applies a world transform (which is controlled by Graphics::SetTransform, ScaleTransform, etc.) followed by the page transform (which is controlled by Graphics::SetPageScale and Graphics::SetPageUnit) to transform the points to device coordinates.
So it normally goes like this: World coordinates --[World transform]--> Page coordinates --[Page transform]--> Device coordinates
You can use Graphics::TransformPoints the way you wanted, to map mouse coordinates to world coordinates, but you have to specify Device coordinates as the source space and World coordinates as the destination space.
However, there are good reasons to do it as Hans describes with a Matrix you store separately, most notably that you shouldn't be holding on to your Graphics object for long enough to process mouse input (nor should there be a need to create one then).
I'm trying to draw a tree within a GEF editor. The problem is that I need to draw it bottom up. I have a primary layer for the node figures, and a connection layer for the connections.
The primary layer is a FreeformLayer, the root edit part a ScalableFreeformLayeredPane. The primary layer has a XYLayout.
Now I need to find the bottom edge of the editor (= viewport???) in order to be able to draw the bottom level of figures ("tokens") at that position (bottom y of primary layer - height of tokens = y of tokens). How can I get that?
I've tried to do it with BorderLayout so the tokens get painted at the bottom of the editor (BorderLayout.BOTTOM), and the nodes above it in BorderLayout.CENTER, but I've run into trouble with selections, and the layout is far from what I want to achieve.
So basically I want to have all nodes in one layer. I can set the position of the tokens, but the nodes above them must be calculated dynamically. How can I do this within XYLayout?
Many thanks in advance!
(Alternatively, positioning the tokens in the y-centered would be acceptable if it's easier to achieve)
You could look at Zest Layout Algorithms to have some inspiration:
http://www.eclipse.org/gef/zest/
I'm looking for a way to programmatically recreate the following effect:
Give an input image:
input http://www.shiny.co.il/shooshx/ConeCarv/q_input.png
I want to iteratively apply the "stroke" effect.
The first step looks like this:
step 1 http://www.shiny.co.il/shooshx/ConeCarv/q_step1.png
The second step like this:
alt text http://www.shiny.co.il/shooshx/ConeCarv/q_step2.png
And so on.
I assume this will involves some kind of edge detection and then tracing the edge somehow.
Is there a known algorithm to do this in an efficient and robust way?
Basically, a custom algorithm would be, according to this thread:
Take the 3x3 neighborhood around a pixel, threshold the alpha channel, and then see if any of the 8 pixels around the pixel has a different alpha value from it. If so paint a
circle of a given radius with center at the pixel. To do inside/outside, modulate by the thresholded alpha channel (negate to do the other side). You'll have to threshold a larger neighborhood if the circle radius is larger than a pixel (which it probably is).
This is implemented using gray-scale morphological operations. This is also the same technique used to expand/contract selections. Basically, to stroke the center of a selection (or an alpha channel), what one would do is to first make two separate copies of the selection. The first selection would be expanded by the radius of the stroke, whereas the second would be contracted. The opacity of the stroke would then be obtained by subtracting the second selection from the first.
In order to do inside and outside strokes you would contract/expand by twice the radius and subtract the parts that intersect with the original selection.
It should be noted that the most general morphological algorithm requires O(m*n) operations, where m is the number of pixels of the image and n is the number of elements in the "structuring element". However, for certain special cases, this can be optimized to O(m) operations (e.g. if the structuring element is a rectangle or a diamond).