SVG Reader Feedback

View: New views
16 Messages — Rating Filter:   Alert me  

SVG Reader Feedback

by Timothy M. Shead :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Folks:

As an FYI, Carlos has committed a first iteration of the SVG reader in
svn ... as general advice, be sure to ping the list whenever you commit
something interesting!

Carlos, the main feedback before you go further is that the K-3D SDK
already provides an XML parser/DOM API that you should use for all XML
work ... see k3dsdk/xml.h, and grep for anything starting with "xml::"
for *lots* of examples.  K-3D's XML API plays better with the Standard
Library than other DOM models, and is up-to two orders of magnitude faster.

Cheers,
Tim




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carlos Dominguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for the feedback, I already commited a second version, I removed all the code using libxml and just use k3d::xml which is really easy to understand actually :)
To be honest I was kind of scared to commit something hehe but there it goes.

BTW, also I've been having some trouble converting my bezier curves to NURBS, which should be really easy (just changing the knot vector) and apparently for the first point of the curve it does it correctly but for the end point it don't and I'm pretty shure the knot vector is fine the way I construct it. I'm going to put an example on the parse_path function and commit it so you see what I mean and could tell me what I'm doing wrong hehe :-) Thanks!

Bests,
Carlos

On Fri, May 16, 2008 at 1:36 AM, Timothy M. Shead <tshead@...> wrote:
Folks:

As an FYI, Carlos has committed a first iteration of the SVG reader in
svn ... as general advice, be sure to ping the list whenever you commit
something interesting!

Carlos, the main feedback before you go further is that the K-3D SDK
already provides an XML parser/DOM API that you should use for all XML
work ... see k3dsdk/xml.h, and grep for anything starting with "xml::"
for *lots* of examples.  K-3D's XML API plays better with the Standard
Library than other DOM models, and is up-to two orders of magnitude faster.

Cheers,
Tim




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Timothy M. Shead :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Carlos Dominguez wrote:

> Thanks for the feedback, I already commited a second version, I
> removed all the code using libxml and just use k3d::xml which is
> really easy to understand actually :)
> To be honest I was kind of scared to commit something hehe but there
> it goes.
>
> BTW, also I've been having some trouble converting my bezier curves to
> NURBS, which should be really easy (just changing the knot vector) and
> apparently for the first point of the curve it does it correctly but
> for the end point it don't and I'm pretty shure the knot vector is
> fine the way I construct it. I'm going to put an example on the
> parse_path function and commit it so you see what I mean and could
> tell me what I'm doing wrong hehe :-) Thanks!

Sure ... while you're at it, you should be passing xml::element around
by-reference instead of by-value, so you aren't needlessly making copies
of the data.

Cheers,
Tim


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carlos Dominguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just solved the NURBS-Bezier convertion problem, and changed the functions as you told me, I hope I get the curve loading complete by today, I'll let you know.

Bests,
Carlos

On Fri, May 16, 2008 at 8:35 PM, Timothy M. Shead <tshead@...> wrote:
Carlos Dominguez wrote:
> Thanks for the feedback, I already commited a second version, I
> removed all the code using libxml and just use k3d::xml which is
> really easy to understand actually :)
> To be honest I was kind of scared to commit something hehe but there
> it goes.
>
> BTW, also I've been having some trouble converting my bezier curves to
> NURBS, which should be really easy (just changing the knot vector) and
> apparently for the first point of the curve it does it correctly but
> for the end point it don't and I'm pretty shure the knot vector is
> fine the way I construct it. I'm going to put an example on the
> parse_path function and commit it so you see what I mean and could
> tell me what I'm doing wrong hehe :-) Thanks!

Sure ... while you're at it, you should be passing xml::element around
by-reference instead of by-value, so you aren't needlessly making copies
of the data.

Cheers,
Tim


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by bART Janssens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, May 17, 2008 at 8:41 PM, Carlos Dominguez <carlosadc@...> wrote:
> I just solved the NURBS-Bezier convertion problem, and changed the functions
> as you told me, I hope I get the curve loading complete by today, I'll let
> you know.

Hi Carlos,

I tried your SVG plugin today, and it works great. I have a minor
concern over the gprim_factory, however. There is already a
gprim_factory in k3dsdk, and in my opinion it would be better to add
to that. I think putting it in the SDK is justified, since it is
already used by at least 3 plugins (obj_import, opencascade and CGAL)
and things were diverging already. Do wait for Tim's opinion on this
as well, though.

As a heads-up for the next steps in your project, I have added a
document_importer to opencascade. It might be useful as an example of
how to import a scene with multiple meshes, covering things like
creating FrozenMeshes to store data, set up MeshInstances, connect
render engines, ...

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carlos Dominguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Bart,

Thanks for the feedback, last week I didn't have much time to work on the project but this week I'll have plenty of time. Actually I just committed a revision where I stopped using my own gprim_factory and use k3d::gprim_factory as you told me (I also noticed the add_polygon had a line missing and I was getting assertion errors but I figured it out) Anyway, I'm going to keep working on it but I have a question about the way NURBS are created in k3d. I suck at explaining things like this so I made a little drawing :-) hehe (which I attached to the email).

To actually import a path from SVG the main problem is to convert the bezier curves from the svg file to k3d NURBS. This shouldn't be a difficult task and I almost have it right, you just need to change the knot, and weight vector accordingly (Figure 1 is how it's supposed to be). The problem is that when I do this in k3d no matter how I change the two middle control point weights, the curve always goes to the top (As shown in figure 2) even when I put a very little weight on them(the middle ones) like 0.01 which would mean that those control points have very little contribution, but in k3d it looks kind of like in figure 3 which made me suspect it is the way it is constructed because as of what I know (please correct me if I'm wrong) the curve should look more or less like figure 4 with that weights. What do you think I should do?  Change the control points accordingly to match the original curve? or should the NURBS construction algorithm change? Thanks in advance!

Bests,
Carlos

On Sun, May 25, 2008 at 4:27 PM, Bart Janssens <bart.janssens@...> wrote:
On Sat, May 17, 2008 at 8:41 PM, Carlos Dominguez <carlosadc@...> wrote:
> I just solved the NURBS-Bezier convertion problem, and changed the functions
> as you told me, I hope I get the curve loading complete by today, I'll let
> you know.

Hi Carlos,

I tried your SVG plugin today, and it works great. I have a minor
concern over the gprim_factory, however. There is already a
gprim_factory in k3dsdk, and in my opinion it would be better to add
to that. I think putting it in the SDK is justified, since it is
already used by at least 3 plugins (obj_import, opencascade and CGAL)
and things were diverging already. Do wait for Tim's opinion on this
as well, though.

As a heads-up for the next steps in your project, I have added a
document_importer to opencascade. It might be useful as an example of
how to import a scene with multiple meshes, covering things like
creating FrozenMeshes to store data, set up MeshInstances, connect
render engines, ...

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

sample.png (25K) Download Attachment

Re: SVG Reader Feedback

by Carsten Haubold :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey Carlos,

I just looked through your code of the nurbs creation part and it looks fine to me. Do you have any svg file containing some Bezier curves so I can play around with it a bit? The weights do work, you can see which values you need to make the curve look as it should by selecting the 2 upper control points and applying a NurbsSetWeights modifier. To test whether the knot vector matches the one you need (which it should in my eyes) you can use the NurbsEditKnotVector modifier.

Hope that helps you with debugging..

Cheers
Carsten


2008/5/26 Carlos Dominguez <carlosadc@...>:
Hi Bart,

Thanks for the feedback, last week I didn't have much time to work on the project but this week I'll have plenty of time. Actually I just committed a revision where I stopped using my own gprim_factory and use k3d::gprim_factory as you told me (I also noticed the add_polygon had a line missing and I was getting assertion errors but I figured it out) Anyway, I'm going to keep working on it but I have a question about the way NURBS are created in k3d. I suck at explaining things like this so I made a little drawing :-) hehe (which I attached to the email).

To actually import a path from SVG the main problem is to convert the bezier curves from the svg file to k3d NURBS. This shouldn't be a difficult task and I almost have it right, you just need to change the knot, and weight vector accordingly (Figure 1 is how it's supposed to be). The problem is that when I do this in k3d no matter how I change the two middle control point weights, the curve always goes to the top (As shown in figure 2) even when I put a very little weight on them(the middle ones) like 0.01 which would mean that those control points have very little contribution, but in k3d it looks kind of like in figure 3 which made me suspect it is the way it is constructed because as of what I know (please correct me if I'm wrong) the curve should look more or less like figure 4 with that weights. What do you think I should do?  Change the control points accordingly to match the original curve? or should the NURBS construction algorithm change? Thanks in advance!

Bests,
Carlos


On Sun, May 25, 2008 at 4:27 PM, Bart Janssens <bart.janssens@...> wrote:
On Sat, May 17, 2008 at 8:41 PM, Carlos Dominguez <carlosadc@...> wrote:
> I just solved the NURBS-Bezier convertion problem, and changed the functions
> as you told me, I hope I get the curve loading complete by today, I'll let
> you know.

Hi Carlos,

I tried your SVG plugin today, and it works great. I have a minor
concern over the gprim_factory, however. There is already a
gprim_factory in k3dsdk, and in my opinion it would be better to add
to that. I think putting it in the SDK is justified, since it is
already used by at least 3 plugins (obj_import, opencascade and CGAL)
and things were diverging already. Do wait for Tim's opinion on this
as well, though.

As a heads-up for the next steps in your project, I have added a
document_importer to opencascade. It might be useful as an example of
how to import a scene with multiple meshes, covering things like
creating FrozenMeshes to store data, set up MeshInstances, connect
render engines, ...

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carlos Dominguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Carsten,

I attached a simple bezier curve arc (actually as you can see is more than that but I haven't implemented the other things yet :-P hehe) but you'll see what I mean. As you saw on the code for my 4 control points bezier curves I use weights 1 for the end points and 0.333 for the middle ones. It might look ok but if you see it in inkscape the curve doesn't go all the way up as it does in k3d. Now if you change in the code from the 0.333 for the middle points to something like 0.01 (try it) you'll see that instead of getting flatter, the arc gets sharper. Thanks for the help!

Bests,
Carlos

On Mon, May 26, 2008 at 3:06 PM, Carsten Haubold <CarstenHaubold@...> wrote:
Hey Carlos,

I just looked through your code of the nurbs creation part and it looks fine to me. Do you have any svg file containing some Bezier curves so I can play around with it a bit? The weights do work, you can see which values you need to make the curve look as it should by selecting the 2 upper control points and applying a NurbsSetWeights modifier. To test whether the knot vector matches the one you need (which it should in my eyes) you can use the NurbsEditKnotVector modifier.

Hope that helps you with debugging..

Cheers
Carsten


2008/5/26 Carlos Dominguez <carlosadc@...>:

Hi Bart,

Thanks for the feedback, last week I didn't have much time to work on the project but this week I'll have plenty of time. Actually I just committed a revision where I stopped using my own gprim_factory and use k3d::gprim_factory as you told me (I also noticed the add_polygon had a line missing and I was getting assertion errors but I figured it out) Anyway, I'm going to keep working on it but I have a question about the way NURBS are created in k3d. I suck at explaining things like this so I made a little drawing :-) hehe (which I attached to the email).

To actually import a path from SVG the main problem is to convert the bezier curves from the svg file to k3d NURBS. This shouldn't be a difficult task and I almost have it right, you just need to change the knot, and weight vector accordingly (Figure 1 is how it's supposed to be). The problem is that when I do this in k3d no matter how I change the two middle control point weights, the curve always goes to the top (As shown in figure 2) even when I put a very little weight on them(the middle ones) like 0.01 which would mean that those control points have very little contribution, but in k3d it looks kind of like in figure 3 which made me suspect it is the way it is constructed because as of what I know (please correct me if I'm wrong) the curve should look more or less like figure 4 with that weights. What do you think I should do?  Change the control points accordingly to match the original curve? or should the NURBS construction algorithm change? Thanks in advance!

Bests,
Carlos


On Sun, May 25, 2008 at 4:27 PM, Bart Janssens <bart.janssens@...> wrote:
On Sat, May 17, 2008 at 8:41 PM, Carlos Dominguez <carlosadc@...> wrote:
> I just solved the NURBS-Bezier convertion problem, and changed the functions
> as you told me, I hope I get the curve loading complete by today, I'll let
> you know.

Hi Carlos,

I tried your SVG plugin today, and it works great. I have a minor
concern over the gprim_factory, however. There is already a
gprim_factory in k3dsdk, and in my opinion it would be better to add
to that. I think putting it in the SDK is justified, since it is
already used by at least 3 plugins (obj_import, opencascade and CGAL)
and things were diverging already. Do wait for Tim's opinion on this
as well, though.

As a heads-up for the next steps in your project, I have added a
document_importer to opencascade. It might be useful as an example of
how to import a scene with multiple meshes, covering things like
creating FrozenMeshes to store data, set up MeshInstances, connect
render engines, ...

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development




--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

cubic01.svg (2K) Download Attachment

Re: SVG Reader Feedback

by Timothy M. Shead :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Carlos Dominguez wrote:

> To actually import a path from SVG the main problem is to convert the
> bezier curves from the svg file to k3d NURBS. This shouldn't be a
> difficult task and I almost have it right, you just need to change the
> knot, and weight vector accordingly (Figure 1 is how it's supposed to
> be). The problem is that when I do this in k3d no matter how I change
> the two middle control point weights, the curve always goes to the top
> (As shown in figure 2) even when I put a very little weight on
> them(the middle ones) like 0.01 which would mean that those control
> points have very little contribution, but in k3d it looks kind of like
> in figure 3 which made me suspect it is the way it is constructed
> because as of what I know (please correct me if I'm wrong) the curve
> should look more or less like figure 4 with that weights. What do you
> think I should do?  Change the control points accordingly to match the
> original curve? or should the NURBS construction algorithm change?
> Thanks in advance!
Carlos:

To create a Bezier curve, all of the control-point weights must be 1.0.  
You probably aren't setting the knot vector correctly.  My recollection
is that the knot vector for a Bezier curve of order k is:

* k identical values for the first control point.
* k identical values for the last control point.
* k-1 identical values for the other control points.

So for your example of an order 3 curve with 4 control points, a
reasonable knot vector would be

0 0 0 1 1 2 2 3 3 3

Cheers,
Tim


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carsten Haubold :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Uhm, I guess you forgot to update CMakeLists.txt? Coz I cant find the plugin in MeshReader

2008/5/26 Carlos Dominguez <carlosadc@...>:
Hi Carsten,

I attached a simple bezier curve arc (actually as you can see is more than that but I haven't implemented the other things yet :-P hehe) but you'll see what I mean. As you saw on the code for my 4 control points bezier curves I use weights 1 for the end points and 0.333 for the middle ones. It might look ok but if you see it in inkscape the curve doesn't go all the way up as it does in k3d. Now if you change in the code from the 0.333 for the middle points to something like 0.01 (try it) you'll see that instead of getting flatter, the arc gets sharper. Thanks for the help!

Bests,
Carlos


On Mon, May 26, 2008 at 3:06 PM, Carsten Haubold <CarstenHaubold@...> wrote:
Hey Carlos,

I just looked through your code of the nurbs creation part and it looks fine to me. Do you have any svg file containing some Bezier curves so I can play around with it a bit? The weights do work, you can see which values you need to make the curve look as it should by selecting the 2 upper control points and applying a NurbsSetWeights modifier. To test whether the knot vector matches the one you need (which it should in my eyes) you can use the NurbsEditKnotVector modifier.

Hope that helps you with debugging..

Cheers
Carsten


2008/5/26 Carlos Dominguez <carlosadc@...>:

Hi Bart,

Thanks for the feedback, last week I didn't have much time to work on the project but this week I'll have plenty of time. Actually I just committed a revision where I stopped using my own gprim_factory and use k3d::gprim_factory as you told me (I also noticed the add_polygon had a line missing and I was getting assertion errors but I figured it out) Anyway, I'm going to keep working on it but I have a question about the way NURBS are created in k3d. I suck at explaining things like this so I made a little drawing :-) hehe (which I attached to the email).

To actually import a path from SVG the main problem is to convert the bezier curves from the svg file to k3d NURBS. This shouldn't be a difficult task and I almost have it right, you just need to change the knot, and weight vector accordingly (Figure 1 is how it's supposed to be). The problem is that when I do this in k3d no matter how I change the two middle control point weights, the curve always goes to the top (As shown in figure 2) even when I put a very little weight on them(the middle ones) like 0.01 which would mean that those control points have very little contribution, but in k3d it looks kind of like in figure 3 which made me suspect it is the way it is constructed because as of what I know (please correct me if I'm wrong) the curve should look more or less like figure 4 with that weights. What do you think I should do?  Change the control points accordingly to match the original curve? or should the NURBS construction algorithm change? Thanks in advance!

Bests,
Carlos


On Sun, May 25, 2008 at 4:27 PM, Bart Janssens <bart.janssens@...> wrote:
On Sat, May 17, 2008 at 8:41 PM, Carlos Dominguez <carlosadc@...> wrote:
> I just solved the NURBS-Bezier convertion problem, and changed the functions
> as you told me, I hope I get the curve loading complete by today, I'll let
> you know.

Hi Carlos,

I tried your SVG plugin today, and it works great. I have a minor
concern over the gprim_factory, however. There is already a
gprim_factory in k3dsdk, and in my opinion it would be better to add
to that. I think putting it in the SDK is justified, since it is
already used by at least 3 plugins (obj_import, opencascade and CGAL)
and things were diverging already. Do wait for Tim's opinion on this
as well, though.

As a heads-up for the next steps in your project, I have added a
document_importer to opencascade. It might be useful as an example of
how to import a scene with multiple meshes, covering things like
creating FrozenMeshes to store data, set up MeshInstances, connect
render engines, ...

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development




--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by bART Janssens-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, May 26, 2008 at 10:59 PM, Timothy M. Shead <tshead@...> wrote:

> To create a Bezier curve, all of the control-point weights must be 1.0.
> You probably aren't setting the knot vector correctly.  My recollection
> is that the knot vector for a Bezier curve of order k is:
>
> * k identical values for the first control point.
> * k identical values for the last control point.
> * k-1 identical values for the other control points.
>
> So for your example of an order 3 curve with 4 control points, a
> reasonable knot vector would be
>
> 0 0 0 1 1 2 2 3 3 3

After failing to understand this from my text book (just as before the
exam ;) I did some experimenting, and finally got it to work. The
curves are of cubic degree, so the order is 4 (degree + 1). There are
4 control points, this means we need 8 elements in the knot vector.
The only useful bit I extracted from the textbook is that knot
multiplicity should be equal to the degree. With this in mind and only
8 slots available, I decided to try the following knot vector, which
seems to work:
0 1 1 1 2 2 2 3
This is the same for all curves extracted from the SVG, so no need to
calculate it. The weights should all be set to 1.

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carlos Dominguez :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Bart! I just tested it and worked. Don't know why because as of what I've read I thought the repeated knots should be the first and last as Tim said but it works so its ok hehe :-)

Thanks
Carlos

On Mon, May 26, 2008 at 5:54 PM, Bart Janssens <bart.janssens@...> wrote:
On Mon, May 26, 2008 at 10:59 PM, Timothy M. Shead <tshead@...> wrote:
> To create a Bezier curve, all of the control-point weights must be 1.0.
> You probably aren't setting the knot vector correctly.  My recollection
> is that the knot vector for a Bezier curve of order k is:
>
> * k identical values for the first control point.
> * k identical values for the last control point.
> * k-1 identical values for the other control points.
>
> So for your example of an order 3 curve with 4 control points, a
> reasonable knot vector would be
>
> 0 0 0 1 1 2 2 3 3 3

After failing to understand this from my text book (just as before the
exam ;) I did some experimenting, and finally got it to work. The
curves are of cubic degree, so the order is 4 (degree + 1). There are
4 control points, this means we need 8 elements in the knot vector.
The only useful bit I extracted from the textbook is that knot
multiplicity should be equal to the degree. With this in mind and only
8 slots available, I decided to try the following knot vector, which
seems to work:
0 1 1 1 2 2 2 3
This is the same for all curves extracted from the SVG, so no need to
calculate it. The weights should all be set to 1.

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback

by Carsten Haubold :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey,

hmm well I'd have said Tims idea for the knot vector is right, but we both are probably too much thinking in the way of NURBS with non fixed knot vector. I just found the part in "The NURBS book" and it says when converting from Bezier to Nurbs you create "a curve with triple internal knots". Hence, Bart is right :)
But apart from that, I'm receiving loads of "too few knots" errors when I load your sample file. What does the S in front of one of the points stand for? I guess thats the reason why it doesnt load correctly. I tested the size of the knot vector which is always 8, but perhaps the 5th point (with the S in front of) gets loaded as point, too.

Cheers,
Carsten

2008/5/27 Carlos Dominguez <carlosadc@...>:
Thanks Bart! I just tested it and worked. Don't know why because as of what I've read I thought the repeated knots should be the first and last as Tim said but it works so its ok hehe :-)

Thanks
Carlos


On Mon, May 26, 2008 at 5:54 PM, Bart Janssens <bart.janssens@...> wrote:
On Mon, May 26, 2008 at 10:59 PM, Timothy M. Shead <tshead@...> wrote:
> To create a Bezier curve, all of the control-point weights must be 1.0.
> You probably aren't setting the knot vector correctly.  My recollection
> is that the knot vector for a Bezier curve of order k is:
>
> * k identical values for the first control point.
> * k identical values for the last control point.
> * k-1 identical values for the other control points.
>
> So for your example of an order 3 curve with 4 control points, a
> reasonable knot vector would be
>
> 0 0 0 1 1 2 2 3 3 3

After failing to understand this from my text book (just as before the
exam ;) I did some experimenting, and finally got it to work. The
curves are of cubic degree, so the order is 4 (degree + 1). There are
4 control points, this means we need 8 elements in the knot vector.
The only useful bit I extracted from the textbook is that knot
multiplicity should be equal to the degree. With this in mind and only
8 slots available, I decided to try the following knot vector, which
seems to work:
0 1 1 1 2 2 2 3
This is the same for all curves extracted from the SVG, so no need to
calculate it. The weights should all be set to 1.

Cheers,

--
Bart

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



--
Carlos Andres Dominguez Caballero
TEL: (52 443) 3147845
CEL: (52 443) 2028344
fismat.umich.mx/~carlosadc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
K3d-development mailing list
K3d-development@...
https://lists.sourceforge.net/lists/listinfo/k3d-development

Re: SVG Reader Feedback