vector-graphics

Render a vector graphic (.svg) in C++

↘锁芯ラ 提交于 2019-11-30 12:57:42
问题 My and a friend are working on a 2D game where the graphics will be .svg files and we will scale them appropriately either by rasterizing them first, or rendering them directly on a surface (which still would require rasterization at some point). The problem is, I've been looking all day to find a library that will allow me to take an .svg file and eventually get it to render in allegro. As far as I know, it would involve rasterization into some sort of format that allegro can read and then

Vector graphics flood fill algorithms?

萝らか妹 提交于 2019-11-30 08:39:35
I am working on a simple drawing application, and i need an algorithm to make flood fills. The user workflow will look like this (similar to Flash CS, just more simpler): the user draws straight lines on the workspace. These are treated as vectors, and can be selected and moved after they are drawn. user selects the fill tool, and clicks on the drawing area. If the area is surrounded by lines in every direction a fill is applied to the area. if the lines are moved after the fill is applied, the area of fill is changed accordingly. Anyone has a nice idea, how to implement such algorithm? The

Python Turtle Module- Saving an image

会有一股神秘感。 提交于 2019-11-30 05:52:16
I would like to figure out how to save a bitmap or vector graphics image after creating a drawing with python's turtle module. After a bit of googling I can't find an easy answer. I did find a module called canvas2svg , but I'm very new to python and I don't know how to install the module. Is there some built in way to save images of the turtle canvas? If not where do I put custom modules for python on an Ubuntu machine? KilyenOrs from Tkinter import * from turtle import * import turtle forward(100) ts = turtle.getscreen() ts.getcanvas().postscript(file="duck.eps") This will help you; I had

Render a vector graphic (.svg) in C++

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 03:58:52
My and a friend are working on a 2D game where the graphics will be .svg files and we will scale them appropriately either by rasterizing them first, or rendering them directly on a surface (which still would require rasterization at some point). The problem is, I've been looking all day to find a library that will allow me to take an .svg file and eventually get it to render in allegro. As far as I know, it would involve rasterization into some sort of format that allegro can read and then allegro could render the "flattened" image. So what are some C++ libraries I could use for taking an

matlab export plot to vector format

坚强是说给别人听的谎言 提交于 2019-11-30 02:55:46
问题 All the time previously I was exporting Matlab figures in a raster format (JPG, PNG) Is there a way to export a plot from Matlab in a vector format (SVG). I need it to inset that plots into LaTeX document. The only thing, I have found so far is a plugin from mathworks and the answer from stackexchange , but this looks rather too complicated 回答1: There is also matlab2tikz and matlabfrag which exports to eps with annotation for importing to LaTeX. Here is an example of mine where I've used

VectorDrawable with GoogleMap BitmapDescriptor

我怕爱的太早我们不能终老 提交于 2019-11-30 02:54:09
I have problem with google maps BitmapDescriptor while creating icon for MarkerOptions using VectorDrawable , API 5.0+ Method used for creation: @NonNull private BitmapDescriptor getBitmapDescriptor(int id) { return BitmapDescriptorFactory.fromResource(id); } Everything works great when id argument contains png drawable, however if I try it with VectorDrawable defined in xml, App always crash when googleMap.addMarker(marker) ( BitmapDescriptor is not null). 11-05 10:15:05.213 14536-14536/xxx.xxxxx.app E/AndroidRuntime: FATAL EXCEPTION: main Process: xxx.xxxxx.app, PID: 14536 java.lang

Efficient Line Smoothing and/or Simplification

廉价感情. 提交于 2019-11-30 02:31:25
I am creating a painting application in Actionscript (although my question is not Actionscript related). The basic idea is to start painting when the mouse is pressed and tracking the mouse movements. What I want to achieve is: reduce mouse "noise" and create more smoother looking lines. Right now, ( 1 ) is problematic because I get thousands of mouse movements within a few seconds. Due to ( 1 ) the line can look jaggy. What current idea: when the user finishes drawing the line, I store all movements in an array and reduce them (median threshold) and then use a spline algorithm to recreate a

Vector graphics in Javascript?

三世轮回 提交于 2019-11-29 23:10:55
One of the advantages of Flash/Flex is that you can use vector graphics (SVG), which is nice. I did a bit of searching around and came across this Javascript vector graphics library . It's pretty simple stuff but it got me thinking: is there any possibility of using vector graphics files such as SVG with Javascript/HTML or it just can't be done or done reasonably? I've used Raphaël Javascript Library and it worked quite well. Currently the library supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+. I know this is a pretty old question, but in case anyone comes across

Shift set of points in 3d

偶尔善良 提交于 2019-11-29 18:26:34
I have a set of points in 3d. I form a line by joining these points. I have to obtain another line which is a shifted version of this line, such that the resultant shift is always to the right of the original line. What would be an approach to solve this problem? How to get the up vectors in the right direction each time? Assume these points to lie on a sphere. Looking at the top view of the sphere i would want something like this /\/\/\/\ /\/\/\/\ The first line is the original set of points and the second one the shifted set Ok i am adding the code std::vector<osg::Vec3> vertArray; // The

How are filled paths rendered?

痴心易碎 提交于 2019-11-29 14:10:36
What are the standard algorithms used in vector graphics for rendering filled paths? I'm not only interested in the process of rendering strokes, I also would like to know how the shapes are filled - how it is determined if given point is inside or outside the path (I believe even specifying the rules of what inside and outside mean is not a straightforward thing). Spektre find outline (perimeter as polygon) this I think you already have triangulate (or cut to convex polygons) there are many approaches like: clip ear Delaunay see Wiki Polygon triangulation fill convex triangles/polygons this