Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33041 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2017-04-18 02:27 -0700 |
| Last post | 2017-04-21 05:27 -0700 |
| Articles | 7 — 1 participant |
Back to article view | Back to comp.lang.javascript
Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-18 02:27 -0700
Re: Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-18 02:39 -0700
Re: Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-18 15:04 -0700
Re: Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-18 18:32 -0700
Re: Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-21 04:58 -0700
Re: Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-21 05:07 -0700
Re: Suggestion change of structure to fit multiple splines jonas.thornvall@gmail.com - 2017-04-21 05:27 -0700
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-18 02:27 -0700 |
| Subject | Suggestion change of structure to fit multiple splines |
| Message-ID | <08500c70-8c68-47fb-8766-e6023907de63@googlegroups.com> |
I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
Using the structure below each spline could be hold as a string.
arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
But i think a structure like
arr[i].nodelinks[j].splinePointX[k]=257;
Would be better faster?
function makeNode(m){
arr[m] = {
nodelinks: [],
hold: false,
rposX: 0,
rposY: 0,
rwidth: 10,
rheigth: 10,
rcolor: "red",
bcolor: "green",
print: true,
BcurveX1:[],
BcurveY1:[],
BcurveX2:[],
BcurveY2:[],
spineStartNode:undefined,
splinePointX:[],
splinePointY:[],
splineEndNode:undefined,
rposZ: 0
};
printnode[m]=m;
}
[toc] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-18 02:39 -0700 |
| Message-ID | <0b3e2533-0d6a-4bec-b8b9-cf5315b90c80@googlegroups.com> |
| In reply to | #33041 |
Den tisdag 18 april 2017 kl. 11:28:06 UTC+2 skrev jonas.t...@gmail.com:
> I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
>
> First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
>
> I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
> I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
>
> If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
>
> Using the structure below each spline could be hold as a string.
> arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
> But i think a structure like
> arr[i].nodelinks[j].splinePointX[k]=257;
> Would be better faster?
>
>
>
> function makeNode(m){
> arr[m] = {
> nodelinks: [],
> hold: false,
> rposX: 0,
> rposY: 0,
> rwidth: 10,
> rheigth: 10,
> rcolor: "red",
> bcolor: "green",
> print: true,
> BcurveX1:[],
> BcurveY1:[],
> BcurveX2:[],
> BcurveY2:[],
> spineStartNode:undefined,
> splinePointX:[],
> splinePointY:[],
> splineEndNode:undefined,
> rposZ: 0
> };
> printnode[m]=m;
> }
Now you can save and load beziers, but i have not done any options for them in editor, once created you are stuck with them. And they always create in doublelinked pairs upon the marked nodes.
But you can mover around and shape conncections with them.
I will make an editorchoice to select singlelinked or doublelinked and of course remove the beziers back to lines.
But before i do those changes i would also like splines to work.
http://anybase.co.nf
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-18 15:04 -0700 |
| Message-ID | <4adf43a6-5417-4ee0-abcd-dfc4edbdfba7@googlegroups.com> |
| In reply to | #33041 |
Den tisdag 18 april 2017 kl. 11:28:06 UTC+2 skrev jonas.t...@gmail.com:
> I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
>
> First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
>
> I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
> I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
>
> If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
>
> Using the structure below each spline could be hold as a string.
> arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
> But i think a structure like
> arr[i].nodelinks[j].splinePointX[k]=257;
> Would be better faster?
>
>
>
> function makeNode(m){
> arr[m] = {
> nodelinks: [],
> hold: false,
> rposX: 0,
> rposY: 0,
> rwidth: 10,
> rheigth: 10,
> rcolor: "red",
> bcolor: "green",
> print: true,
> BcurveX1:[],
> BcurveY1:[],
> BcurveX2:[],
> BcurveY2:[],
> spineStartNode:undefined,
> splinePointX:[],
> splinePointY:[],
> splineEndNode:undefined,
> rposZ: 0
> };
> printnode[m]=m;
> }
I found this code for three dimensional, but it woult be nice with named subelements is it possible?
I want something like this
arr[i].nodelinks[j].splinePointX[k]=257;
var myArr = new Array();
myArr[0] = new Array();
myArr[0][0] = new Array()
myArr[0][0][0] = "test";
myArr[0][0][1] = "testnew";
alert(myArr[0][0][1]);
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-18 18:32 -0700 |
| Message-ID | <736ca996-0bf1-4dbe-9d18-3b2938e290ee@googlegroups.com> |
| In reply to | #33048 |
Den onsdag 19 april 2017 kl. 00:04:34 UTC+2 skrev jonas.t...@gmail.com:
> Den tisdag 18 april 2017 kl. 11:28:06 UTC+2 skrev jonas.t...@gmail.com:
> > I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
> >
> > First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
> >
> > I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
> > I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
> >
> > If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
> >
> > Using the structure below each spline could be hold as a string.
> > arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
> > But i think a structure like
> > arr[i].nodelinks[j].splinePointX[k]=257;
> > Would be better faster?
> >
> >
> >
> > function makeNode(m){
> > arr[m] = {
> > nodelinks: [],
> > hold: false,
> > rposX: 0,
> > rposY: 0,
> > rwidth: 10,
> > rheigth: 10,
> > rcolor: "red",
> > bcolor: "green",
> > print: true,
> > BcurveX1:[],
> > BcurveY1:[],
> > BcurveX2:[],
> > BcurveY2:[],
> > spineStartNode:undefined,
> > splinePointX:[],
> > splinePointY:[],
> > splineEndNode:undefined,
> > rposZ: 0
> > };
> > printnode[m]=m;
> > }
>
> I found this code for three dimensional, but it woult be nice with named subelements is it possible?
> I want something like this
> arr[i].nodelinks[j].splinePointX[k]=257;
>
>
>
>
> var myArr = new Array();
> myArr[0] = new Array();
> myArr[0][0] = new Array()
> myArr[0][0][0] = "test";
> myArr[0][0][1] = "testnew";
>
> alert(myArr[0][0][1]);
Maybe i just could hang it on and see what happens, maybe it just fit together the parts. I mean i do not even understand how arr[].nodelinks[] can hang together so i just will try hang on arr[].nodelinks[].splinePointX[]
and see what the interpretator says, what do i know maybe it make it a 3 dimensional array?
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-21 04:58 -0700 |
| Message-ID | <6a0896cb-427f-425b-9802-7431735e6dc3@googlegroups.com> |
| In reply to | #33041 |
Den tisdag 18 april 2017 kl. 11:28:06 UTC+2 skrev jonas.t...@gmail.com:
> I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
>
> First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
>
> I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
> I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
>
> If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
>
> Using the structure below each spline could be hold as a string.
> arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
> But i think a structure like
> arr[i].nodelinks[j].splinePointX[k]=257;
> Would be better faster?
>
>
>
> function makeNode(m){
> arr[m] = {
> nodelinks: [],
> hold: false,
> rposX: 0,
> rposY: 0,
> rwidth: 10,
> rheigth: 10,
> rcolor: "red",
> bcolor: "green",
> print: true,
> BcurveX1:[],
> BcurveY1:[],
> BcurveX2:[],
> BcurveY2:[],
> spineStartNode:undefined,
> splinePointX:[],
> splinePointY:[],
> splineEndNode:undefined,
> rposZ: 0
> };
> printnode[m]=m;
> }
My idea for howto actually draw the splines is simple and also maybe need modification, i do not beleive in traversing the route drawing it out "slow".
But it may be necessary to not cause inconsistencies "if you make splines using the ordinary nodes, or spline node could be of another type never interfering.
But that would be weird if you want to attach ordinary links to them no they have to be ordinary nodes and routed "not stored locally" to be useful.
Routed and have an order, they are not written out unless the node itself is the first part of the chain. The prevention from the ordinary "line" to be written could be the same as for bezier, you just check if there is a spline and then it overrules the rule to write out line.
function makeNode(m){
arr[m] = {
nodelinks: [],
hold: false,
rposX: 0,
rposY: 0,
rwidth: 10,
rheigth: 10,
rcolor: "red",
bcolor: "green",
print: true,
BcurveX1:[],
BcurveY1:[],
BcurveX2:[],
BcurveY2:[],
splineNode:[],
rposZ: 0
};
printnode[m]=m;
}
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-21 05:07 -0700 |
| Message-ID | <4cce9d7a-1651-46b4-a743-a645a4667dfb@googlegroups.com> |
| In reply to | #33084 |
Den fredag 21 april 2017 kl. 13:58:08 UTC+2 skrev jonas.t...@gmail.com:
> Den tisdag 18 april 2017 kl. 11:28:06 UTC+2 skrev jonas.t...@gmail.com:
> > I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
> >
> > First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
> >
> > I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
> > I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
> >
> > If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
> >
> > Using the structure below each spline could be hold as a string.
> > arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
> > But i think a structure like
> > arr[i].nodelinks[j].splinePointX[k]=257;
> > Would be better faster?
> >
> >
> >
> > function makeNode(m){
> > arr[m] = {
> > nodelinks: [],
> > hold: false,
> > rposX: 0,
> > rposY: 0,
> > rwidth: 10,
> > rheigth: 10,
> > rcolor: "red",
> > bcolor: "green",
> > print: true,
> > BcurveX1:[],
> > BcurveY1:[],
> > BcurveX2:[],
> > BcurveY2:[],
> > spineStartNode:undefined,
> > splinePointX:[],
> > splinePointY:[],
> > splineEndNode:undefined,
> > rposZ: 0
> > };
> > printnode[m]=m;
> > }
>
> My idea for howto actually draw the splines is simple and also maybe need modification, i do not beleive in traversing the route drawing it out "slow".
>
> But it may be necessary to not cause inconsistencies "if you make splines using the ordinary nodes, or spline node could be of another type never interfering.
>
> But that would be weird if you want to attach ordinary links to them no they have to be ordinary nodes and routed "not stored locally" to be useful.
>
> Routed and have an order, they are not written out unless the node itself is the first part of the chain. The prevention from the ordinary "line" to be written could be the same as for bezier, you just check if there is a spline and then it overrules the rule to write out line.
>
> function makeNode(m){
> arr[m] = {
> nodelinks: [],
> hold: false,
> rposX: 0,
> rposY: 0,
> rwidth: 10,
> rheigth: 10,
> rcolor: "red",
> bcolor: "green",
> print: true,
> BcurveX1:[],
> BcurveY1:[],
> BcurveX2:[],
> BcurveY2:[],
> splineNode:[],
> rposZ: 0
> };
> printnode[m]=m;
> }
Splines themself isn't that hard, but to get them to fit within a structural context, requires some thought.
It is like LEGO
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-04-21 05:27 -0700 |
| Message-ID | <3b7194ff-d7c6-41fe-9111-6a5fce3e11be@googlegroups.com> |
| In reply to | #33085 |
Den fredag 21 april 2017 kl. 14:07:39 UTC+2 skrev jonas.t...@gmail.com:
> Den fredag 21 april 2017 kl. 13:58:08 UTC+2 skrev jonas.t...@gmail.com:
> > Den tisdag 18 april 2017 kl. 11:28:06 UTC+2 skrev jonas.t...@gmail.com:
> > > I wanted to add splines to my array structure of nodes but i know to little about howto make array dependencies. I manage to make substructures like arr[i].nodelinks[j] but now there is another depth of level and i do not know howto resolv it without resort into create strings. Because each node can have many splines. So my suggested solution below would have to make a string of the nodes that make up the spline.
> > >
> > > First i wasn't sure if the spline points should be attachable nodes at all it is just a curve afterall, but then i realised make things like tubes rods and cones, and so on they should be connectable in the mesh/grid.
> > >
> > > I had no problem with beziers because they are just 2 points, so i use them as overlay on the original connections. However with splines they can contain any number of points. But in the showcase i constructed below there can only be a single spline at each node.
> > > I guess what i really would like is a structure like arr[i].nodelinks[j].spline[k] here spline is a "subelement?" connected to each nodelink, rather then each arr.
> > >
> > > If anyone can show me howto acheive it i do not have to resort to stringhandling, which i beleive would be alot slower leading to performance penalties?
> > >
> > > Using the structure below each spline could be hold as a string.
> > > arr[i].splinePointX[j]="*111*700*233*368*911";//Coordinates
> > > But i think a structure like
> > > arr[i].nodelinks[j].splinePointX[k]=257;
> > > Would be better faster?
> > >
> > >
> > >
> > > function makeNode(m){
> > > arr[m] = {
> > > nodelinks: [],
> > > hold: false,
> > > rposX: 0,
> > > rposY: 0,
> > > rwidth: 10,
> > > rheigth: 10,
> > > rcolor: "red",
> > > bcolor: "green",
> > > print: true,
> > > BcurveX1:[],
> > > BcurveY1:[],
> > > BcurveX2:[],
> > > BcurveY2:[],
> > > spineStartNode:undefined,
> > > splinePointX:[],
> > > splinePointY:[],
> > > splineEndNode:undefined,
> > > rposZ: 0
> > > };
> > > printnode[m]=m;
> > > }
> >
> > My idea for howto actually draw the splines is simple and also maybe need modification, i do not beleive in traversing the route drawing it out "slow".
> >
> > But it may be necessary to not cause inconsistencies "if you make splines using the ordinary nodes, or spline node could be of another type never interfering.
> >
> > But that would be weird if you want to attach ordinary links to them no they have to be ordinary nodes and routed "not stored locally" to be useful.
> >
> > Routed and have an order, they are not written out unless the node itself is the first part of the chain. The prevention from the ordinary "line" to be written could be the same as for bezier, you just check if there is a spline and then it overrules the rule to write out line.
> >
> > function makeNode(m){
> > arr[m] = {
> > nodelinks: [],
> > hold: false,
> > rposX: 0,
> > rposY: 0,
> > rwidth: 10,
> > rheigth: 10,
> > rcolor: "red",
> > bcolor: "green",
> > print: true,
> > BcurveX1:[],
> > BcurveY1:[],
> > BcurveX2:[],
> > BcurveY2:[],
> > splineNode:[],
> > rposZ: 0
> > };
> > printnode[m]=m;
> > }
>
> Splines themself isn't that hard, but to get them to fit within a structural context, requires some thought.
>
> It is like LEGO
Structural it will be weird only first "node" within a spline doing it all, the others just containers that tells program that "line" should not be written out.
So first node buffer all chain, "the other could hold chain to but do not need, just something to tell they belong to chain"
arr{3].nodelinks[7].splineNode[3,7,11,2,23,67]
Spline is done written out.
arr{7}.nodelinks[11].splineNode[3,7,11,2,23,67]
No spline written out but is splineNode length != 0 we do now that we should not write out the line.
So it seem for every pair arr and nodelinks we need to check that arr[].nodelinks[].splineNode[] is empty to draw a line "or" bezier.
I think i nailed the logic down, whay do you think?
We do it all in one sweep, and then we reject the relations included, they can not be bezier nor lines, because they were part of a spline?
Does that logic seem sound?
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web