Wings 3D Development Forum

Full Version: SVG plugin additions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Hello,

I've pushed a branch for the changes I've made so far:
https://github.com/elblake/wings/
The branch name is eb/svg-additions

beam file available:
wpc_svg_path.tar
I've made an update to fix some specific bug.

new beam file:
wpc_svg_path.tar
.Nice.
Whe you finish them don't forget to make the PR to dgud's repository.
Thanks, I made a PR.
Hi! edb
I have tried your SVG plugin and emf/wmf plugin.
It is very nice plugin.
The generated 3d objects were also firmly.
And Thank you for support 2byte character filename import.

By the way, I favorite the feature where the imported emf/wmf file's shape colors are applied to the vertex colors.
When importing SVG format, is it possible to add a vertex color corresponding to the shape color?
I made SVG file by Illustrator to randomly color the shapes(set CMYK and/or RGB color), but 3d objects has filled grey color only.

------------
tkbd
Hello and thank you tkbd.

The imported SVG should in many cases get the color for the shape when importing.
If you have a SVG file that illustrator exported I could take a look at the SVG file to see how it sets the colors.
Thank you for reply.
Due to your advice,I understand why it cause.
I was specifying a style element in the SVG export options of Illustrator. Sad

Then,It import successfully with coloring if the file is marked up by style and Presentation attribute.
Hereafter I decided to use Style or Presentation attributes options. Smile

I left a following info for share information with every Wings3D users.
Adobe Illustrator has many export option,and they marked up different way.
  • Supported :Color defined by Style attribute. e.g. style="fill:#f00;"
  • Supported :Color defined by Presentation attribute. e.g. fill="#f00"
  • No support :Color defined by Style element with CSS class. e.g. .red{fill:#f00;} and class="red"
(It also helps check the code of SVG files that made by unknown authoring software to see if colors can imported.)

thank you!
Thank you tkbd for the feedback.
Hi!,edb.
I found a issue in this plugin.
In SVG importer,Two circle shapes are overlapping,and checked "combine all paths" in Wings3D SVG importer.
But no combined them.
[Image: br1JvbV.png]
Note:I'm not check this in other vector file importers.
(e.g. Circle objects's overlapping)

SVG file data is here
(two_circle_tag_sample.svg)
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
     y="0px" width="595.28px" height="841.89px" viewBox="0 0 595.28 841.89" style="enable-background:new 0 0 595.28 841.89;"
     xml:space="preserve">
<circle style="fill:#00FF00;stroke:#000000;stroke-miterlimit:10;" cx="166.456" cy="139.773" r="104.545"/>
<circle style="fill:#006837;stroke:#000000;stroke-width:0.5065;stroke-miterlimit:10;" cx="166.456" cy="139.773" r="52.955"/>
<path style="fill:#00FF00;stroke:#000000;stroke-miterlimit:10;" d="M166.456,319.318c-57.738,0-104.545,46.806-104.545,104.545
    c0,57.74,46.807,104.547,104.545,104.547c57.739,0,104.546-46.807,104.546-104.547C271.001,366.125,224.195,319.318,166.456,319.318
    z M166.456,476.818c-29.246,0-52.954-23.709-52.954-52.955c0-29.246,23.708-52.954,52.954-52.954s52.955,23.708,52.955,52.954
    C219.411,453.109,195.702,476.818,166.456,476.818z"/>
<path style="fill:#00FF00;stroke:#000000;stroke-miterlimit:10;" d="M548.273,139.773c0,28.87-11.701,55.006-30.621,73.925
    c-18.918,18.919-45.055,30.621-73.924,30.621s-55.006-11.702-73.924-30.621c-18.92-18.919-30.621-45.056-30.621-73.925
    s11.701-55.006,30.621-73.925c18.918-18.919,45.055-30.621,73.924-30.621s55.006,11.702,73.924,30.621
    C536.572,84.767,548.273,110.903,548.273,139.773z"/>
<path style="fill:#006837;stroke:#000000;stroke-width:0.5065;stroke-miterlimit:10;" d="M496.684,139.773
    c0,14.623-5.928,27.862-15.51,37.445c-9.584,9.583-22.822,15.51-37.445,15.51s-27.861-5.927-37.445-15.51
    c-9.582-9.583-15.51-22.822-15.51-37.445s5.928-27.862,15.51-37.444c9.584-9.583,22.822-15.51,37.445-15.51
    s27.861,5.927,37.445,15.51C490.756,111.911,496.684,125.15,496.684,139.773z"/>
<path style="fill:#00FF00;stroke:#000000;stroke-miterlimit:10;" d="M517.652,349.939c-18.918-18.919-45.055-30.621-73.924-30.621
    s-55.006,11.702-73.924,30.621c-18.92,18.918-30.621,45.055-30.621,73.924c0,28.87,11.701,55.007,30.621,73.926
    c18.918,18.92,45.055,30.621,73.924,30.621s55.006-11.701,73.924-30.621c18.92-18.919,30.621-45.056,30.621-73.926
    C548.273,394.994,536.572,368.857,517.652,349.939z M481.174,461.309c-9.584,9.582-22.822,15.51-37.445,15.51
    s-27.861-5.928-37.445-15.51c-9.582-9.584-15.51-22.822-15.51-37.445s5.928-27.861,15.51-37.444
    c9.584-9.583,22.822-15.51,37.445-15.51s27.861,5.927,37.445,15.51c9.582,9.583,15.51,22.821,15.51,37.444
    S490.756,451.725,481.174,461.309z"/>
<text transform="matrix(1 0 0 1 136.9092 598.8643)" style="font-family:'KozGoPro-Regular-83pv-RKSJ-H'; font-size:31.5554;">Circle</text>
<text transform="matrix(1 0 0 1 419.8643 598.8643)" style="font-family:'KozGoPro-Regular-83pv-RKSJ-H'; font-size:31.5554;">Path</text>
<text transform="matrix(1 0 0 1 13.0459 38.6367)" style="font-family:'KozGoPro-Regular-83pv-RKSJ-H'; font-size:17.0079;">Overlap</text>
<text transform="matrix(1 0 0 1 13.0459 319.3188)" style="font-family:'KozGoPro-Regular-83pv-RKSJ-H'; font-size:17.0079;">Combined</text>
<line style="fill:none;stroke:#000000;stroke-miterlimit:10;" x1="308.5" y1="22.727" x2="308.5" y2="584.091"/>
<g>
    <g>
        <line style="fill:none;stroke:#000000;stroke-miterlimit:10;" x1="3.538" y1="279.545" x2="9.538" y2="279.545"/>
        
            <line style="fill:none;stroke:#000000;stroke-miterlimit:10;stroke-dasharray:12.1921,12.1921;" x1="21.729" y1="279.545" x2="552.086" y2="279.545"/>
        <line style="fill:none;stroke:#000000;stroke-miterlimit:10;" x1="558.182" y1="279.545" x2="564.182" y2="279.545"/>
    </g>
</g>
</svg>
Thanks for the bug report tkbd.

I'll have to take a look at where the problem is happening if it is in wpc_svg_path or wpc_ai which does the combining to mesh.
Pages: 1 2 3 4