How to reproduce this shape with CSS? - geometry

Shape to reproduce with CSS
Not found here :(
Thanks.

Since it is not a standard shape, if you want the shape just for display, then the easiest way would be to create a vector image of the shape that you want and import it into your page. If this doesn't work, then there are few different ways of generating irregular shapes.
Have a look at this article, it has some useful information towards the end of how you can achieve that.

Related

How to merge multiple colors and objects of different sizes into an image in Inkscape

Hi Inkscape learners and professionals,
I am learning Inkscape. I am trying to merge multiple colors or ornaments of different shapes, sizes, and colors into an object/picture. I want to see my final image with no colors or any objects beyond the boundaries of my image. Is there any specific tool I can use in Inkscape or tutorials on this to watch? Please see an example here.
Let’s say, I have this vector file:
And I want the final image to look like this:
Any advice and suggestions would be appreciated. Thank you.
As mentioned above by #Juancho, you must learn Masking and clipping which is mostly used in all graphic design softwares.
Your problem can be resolved by simple clipping (Inkscape -> Object -> Clip ->set). Check it out:
https://imgur.com/Taftj2Y

SVG icon from Sketch is corrupted

I have icon in Sketch, but when I export it to SVG, it's somehow corrupted. I have no idea why and how to solve that. Can you help me?
Result:
Source: http://test.marekcernak.cz/leave.sketch
Redraw your leaf design to avoid paths that overlap themselves.
I don't use Sketch, but there have been similar questions relating to Sketch and issues it has regarding incompatible support for fill-rule (a.k.a. winding rule). For example see this this question.
If you fix the overlaps, I believe you should have much better results when you export to SVG.
It seems like you have style collision with other SVGs that you have exported to use in the same page. Make sure you use unique names for id and class attributes.

What is the correct way to achieve intersection of multiple clip paths?

As described in another post, I am trying to recreate an SVG from vector graphics commands in a PDF and I am facing some difficulty in the part where I need to intersect a set of clip paths. For instance, the raw SVG has a few clip path elements line #16 which need to be intersected and applied on the rectangle fill (line #17) to obtain what looks like this: .
I am not clear about the correct and the best way to achieve intersection of multiple clip paths in an SVG. I wasn't able to find much information about this on the web except this one, going by which I came up with this SVG where I introduce a sequence of additional clipPath elements which try to intersect the current intersection with the next original clipPath to be added to the intersection set. This approach seems rather inelegant to me. Besides, that SVG doesn't seem to work on some versions of Firefox (ESR 17.x) though it renders the expected result on Firefox 5, Chrome and IE. Is there something wrong with the SVG? Or even if it is correct, is there a simpler/better way to achieve the intersection?
The way you've done it seens reasonable. There's a w3c example in the testsuite.

Paperjs write text

I'm trying to understand how Paperjs works and I would like to know if it's possible to write text vectors, if yes how?
I tried Raphael.js before this, and I was almost satisfied with it but it seems that Paperjs is more (cross)browser compliant for some reasons, right?
Some examples would be nice!
Thanks for your answers.
Yes, it is definitely possible to create texts in paper.js.
var awesometext = new paper.PointText();
awesometext.content='awesome';
paper is better than raphael because its canvas based. Canvas is better supported on mobiles/tabs and hence the advantage of paperjs. However, since canvas is just a bitmap implementation, zooming will make canvas renderings not so good compared to svg renderings like in raphael.
So, it depends on what your priorities are for your application..
Paperjs handles text-scaling well, but it uses canvas' native methods to render the characters, so you can't access the vector data once they're drawn. But I imagine you'd only want vector characters to manipulate their shape, for example, morphing one letter into another, or creating a font editor.
If you just want hi res text then paperjs can do that no problem... or you could just set a bigger font size.
If you want to render text as vectors in paperjs, have a look at https://nodebox.github.io/opentype.js/

Advanced CSS Circles

I'm trying to make 3 different circles to my website. I don't want to insert it as a graphic/image file. So I've been trying to achieve it using CSS3, but I can't really work my fingers around it.
What will it look like?
I have uploaded a picture of what I'm trying to achieve at: www.sp34k.com/etc/circles.jpg
I can't really show the code I've been trying to use to achieve this, as it all looks totally weird and nothing floats currectly.
What I've tried
What I've tried is to make 3 circles with position absolute and then use % (percentage) to determine the width of the colored parts, but I can't twist my mind around how it should be set up.
Any suggestions is appreciated,
Mike
Here is a simple try of me to achieve the effect you want:
DEMO
edit: css-only solution
It can be easily animated with javascript or keyframes. Arbitrary content would go into the inner div. To change the percentage, simply adjust the angle of the pseudo-elements.
With a little more effort this could be easily refined I guess;)
Note: the transform has the webkit-prefix, so it works only in chrome/safari - to see it in firefox or other browsers, you need to change the prefix.
P.S. I will animate it when I'm home from work.
Good one by Christoph but he is using SASS/SCSS which are comparatively slow then normal CSS because they have to be converted to CSS before browser render it so I have have a different Solution for you
try this fiddle

Resources