I'm working on a project where I can take my lettering pieces I do on illustrator with the pen tool and take the bezier point coordinates (curves and all) into processing bezier() function so I can individually manipulate the points with different formulas for animation.
I've tried using Adobe Point Exporter but it seems to only give the x, y coordinates without the curves. I've found a library for processing called Geomerative but I couldn't figure out how to export the coordinates into specific bezier points that I can import into bezier()
Thanks for taking the time to read this!
You can try export lettering into svg format and then use Processing loadShape function to load geometry into varible of type PShape:
https://processing.org/reference/loadShape_.html
Related
I'm trying to figure out a good way to programmatically generate contours describing a 2D surface, from a 3D STEP model. Application is generating NC code for a laser-cutting program from a 3D model.
Note: it's easy enough to do this in a wide variety of CAD systems. I am writing software that needs to do it automatically.
For example, this (a STEP model):
Needs to become this (a vector file, like an SVG or a DXF):
Perhaps the most obvious way of tackling the problem is to parse the STEP model and run some kind of algorithm to detect planes and select the largest as the cut surface, then generate the contour. Not a simple task!
I've also considered using a pre-existing SDK to render the model using an orthographic camera, capture a high-res image, and then operating on it to generate the appropriate contours. This method would work, but it will be CPU-heavy, and its accuracy will be limited to the pixel resolution of the rendered image - not ideal.
This is perhaps a long shot, but does anyone have thoughts about this? Cheers!
I would use a CAD library to load the STEP file (not a CAD API), look for the planar face with the higher number of edge curves in the face loop and transpose them on the XY plane. Afterward, finding 2D geometry min/max for centering etc. would be pretty easy.
Depending on the programming language you are using I would search for "CAD control" or "CAD component" on Google combining it with "STEP import".
Given an STL file, OpenSCAD is able to import it:
import("file.stl");
I can also transform the result. However, when I try to do any openscad commands, the imported shape disappears:
translate([10,0,0])
import("Boat.stl");
cube(5);
Once the function call is added to any native shape, the boat disappears. Is there any way around this? I am trying to take a shape that has been sliced into pieces in netfabb, and create tabs so the the pieces fit precisely together for gluing.
Being used to Matlab and its great capabilities of drawing vector graphics, I am looking for something similar in OpenCV. OpenCV drawing functions seem to raster the lines or points at pixel level. Currently, I am dumping the data into text, copy-paste to Matlab and doing all the plots. I also thought about using Matlab engine to pass it the parameters and running plots, but it seems to be too much mess for simple debug operation.
I want to be able to do the following:
Zoom in, out of the image
Draw a line/point which is re-rastered each time I do zoom, like in Matlab.
Currently, I found image watch plugin to take care of zooming, but it does not help with the second part.
Any idea?
OpenCV has a lot of capabilities to process an image but only minimal ones for displaying the result. It has nothing that can display vector graphics like Matlab. When I need to see polygons on image (or just polygons) I am dumping them to file and using third party viewer (usually Giv viewer).
How to use gtk-3 to build a scribble program.I found example in gtk-3 official website ,but while drawing it uses the cairo_rectangle to draw the user input. it very very slow compare to gtk_draw_lines()in gtk-2. Cairo funcions cannot be able to capture data pixel by pixel.
what i want , is there any function in gtk-3 to draw very faster ,able to capture (x,y) point and draw that point by pixel to pixel in my draw area?
The documentation for gdk_draw_lines tells it's deprecated, because all the drawing has been delegated to cairo a long time ago. The documentation tells that you may use cairo_line_to to connect your points, and cairo_stroke to draw a line between those points.
ADDENDUM:
Cairo is a vector graphics library: by design and on purpose, it's not designed to do pixel per pixel access. However you may trick it by changing your transformation matrix so that it reflects your pixel coordinates. Give a look at the CTM (Current Transformation Matrix) modification functions, in particular cairo_scale. You may catch the configure-event of your GtkDrawingArea to be notified when its size changes and have a chance to modify the CTM accordingly.
I have two images of yeast plates:
Permissive:
Xgal:
The to images should be in the same spot and roughly the same size. I am trying to use one of the images to generate a grid and then apply that grid to the other image. The grid is made by looking at the colonies on permissive plate, the plate should have 1536 colonies on it. The problem is that the camera that was used to take the images moves a bit up and down and the images can also be shifted slightly due to the other plate not being in exactly the same place.
This then means that when I use the permissive plate to generate the grid on the xgal plate the grid shifts. Does anyone know a way in which I can compensate for this? I am using perl with the gd module. Any advice would be greatly appreciated. Thank you
I've done this in other languages in relation to motion analysis. You can mathematically determine the shift in position between two images using cross correlation.
Fortunately, you may not need to actually do the maths :) You could use something like ImageMagick, which provides a lot of image processing functions for you, and is perl scriptable. Independently scripts already exists for tasks very much like yours -- see.
If you have only a few pairs of images and, as in the examples, they are very different in appearance then an alternative method to Tim Barrass' would be
Open the first image in gimp, find the co-ordinates of a landmark feature
Open the second image in gimp, find the co-ordinates of the same landmark
Calculate the offset
Shift the second image using ImageMagick's convert command with the affine option. Set the parameters sx=sy=1.0, rx=ry=0.0, tx= negative horizontal offset, ty= negative vertical offset