To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.dat.parts.primitivesOpen lugnet.cad.dat.parts.primitives in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / LDraw Files / Parts / Primitives / 350
     
   
Special: 
[DAT] (requires LDraw-compatible viewer)
Subject: 
Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Fri, 15 Aug 2003 05:45:01 GMT
Viewed: 
3076 times
  

I recently reworked the stud 5 primitive to make use of more quarter cylinders.
I then noticed that when viewed there were edge lines apearing where they
shouldn't. If you look at the primitive from various points you can see this
occur.



0 Stud Scala
0 Name: stud5.dat
0 Author: Tore Eriksson
0 LDRAW_ORG Primitive UPDATE 2002-02
0 BFC CERTIFY CW
0 2002-04-04 SEB Modified for BFC compliance
0
0 BFC INVERTNEXT
1 16 0 -4 0 8 0 0 0 4 0 0 0 8  4-4cyli.dat
1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud.dat
1 16 0 0 0 8 0 0 0 1 0 0 0 8  4-4edge.dat
1 16 0 -4 0 8 0 0 0 1 0 0 0 8  4-4edge.dat
1 16 0 -4 0 5.66 0 5.66 0 1 0 -5.66 0 5.66  4-4ndis.dat
0
1 16 10 0 10 4.24 0 4.24 0 1 0 -4.24 0 4.24 2-4edge.dat
1 16 10 0 10 4.24 0 4.24 0 -4 0 -4.24 0 4.24 2-4cyli.dat
1 16 10 -4 10 4.24 0 4.24 0 1 0 -4.24 0 4.24 2-4edge.dat
1 16 10 -4 10 4.24 0 4.24 0 1 0 -4.24 0 4.24 2-4disc.dat
0
4 16 14.25 -4 5.80 12.47 -4 3.14 3.14 -4 12.47 5.80 -4 14.25
4 16 12.47 -4 3.14 11.85 -4 0 0 -4 11.85 3.14 -4 12.47
4 16 11.85 -4 0 11.32 -4 0 0 -4 11.32 0 -4 11.85
0
0 BFC INVERTNEXT
1 16 0 -4 20.05 -5.80 0 5.80 0 4 0 -5.80 0 -5.80 1-4cyli.dat
1 16 0 0 20.05 -5.80 0 5.80 0 1 0 -5.80 0 -5.80 1-4edge.dat
1 16 0 -4 20.05 -5.80 0 5.80 0 1 0 -5.80 0 -5.80 1-4edge.dat
0
1 16 -10 0 10 4.24 0 -4.24 0 1 0 4.24 0 4.24 2-4edge.dat
1 16 -10 0 10 4.24 0 -4.24 0 -4 0 4.24 0 4.24 2-4cyli.dat
1 16 -10 -4 10 4.24 0 -4.24 0 1 0 4.24 0 4.24 2-4edge.dat
1 16 -10 -4 10 4.24 0 -4.24 0 1 0 4.24 0 4.24 2-4disc.dat
0
4 16 -5.80 -4 14.25 -3.14 -4 12.47 -12.47 -4 3.14 -14.25 -4 5.80
4 16 -3.14 -4 12.47 0 -4 11.85 -11.85 -4 0 -12.47 -4 3.14
4 16 0 -4 11.85 0 -4 11.32 -11.32 -4 0 -11.85 -4 0
0
0 BFC INVERTNEXT
1 16 -20.05 -4 0 5.80 0 5.80 0 4 0 -5.80 0 5.80 1-4cyli.dat
1 16 -20.05 0 0 5.80 0 5.80 0 1 0 -5.80 0 5.80 1-4edge.dat
1 16 -20.05 -4 0 5.80 0 5.80 0 1 0 -5.80 0 5.80 1-4edge.dat
0
1 16 -10 0 -10 -4.24 0 -4.24 0 1 0 4.24 0 -4.24 2-4edge.dat
1 16 -10 0 -10 -4.24 0 -4.24 0 -4 0 4.24 0 -4.24 2-4cyli.dat
1 16 -10 -4 -10 -4.24 0 -4.24 0 1 0 4.24 0 -4.24 2-4edge.dat
1 16 -10 -4 -10 -4.24 0 -4.24 0 1 0 4.24 0 -4.24 2-4disc.dat
0
4 16 -14.25 -4 -5.80 -12.47 -4 -3.14 -3.14 -4 -12.47 -5.80 -4 -14.25
4 16 -12.47 -4 -3.14 -11.85 -4 0 0 -4 -11.85 -3.14 -4 -12.47
4 16 -11.85 -4 0 -11.32 -4 0 0 -4 -11.32 0 -4 -11.85
0
0 BFC INVERTNEXT
1 16 0 -4 -20.05 5.80 0 -5.80 0 4 0 5.80 0 5.80 1-4cyli.dat
1 16 0 0 -20.05 5.80 0 -5.80 0 1 0 5.80 0 5.80 1-4edge.dat
1 16 0 -4 -20.05 5.80 0 -5.80 0 1 0 5.80 0 5.80 1-4edge.dat
0
1 16 10 0 -10 -4.24 0 4.24 0 1 0 -4.24 0 -4.24 2-4edge.dat
1 16 10 0 -10 -4.24 0 4.24 0 -4 0 -4.24 0 -4.24 2-4cyli.dat
1 16 10 -4 -10 -4.24 0 4.24 0 1 0 -4.24 0 -4.24 2-4edge.dat
1 16 10 -4 -10 -4.24 0 4.24 0 1 0 -4.24 0 -4.24 2-4disc.dat
0
4 16 5.80 -4 -14.25 3.14 -4 -12.47 12.47 -4 -3.14 14.25 -4 -5.80
4 16 3.14 -4 -12.47 0 -4 -11.85 11.85 -4 0 12.47 -4 -3.14
4 16 0 -4 -11.85 0 -4 -11.32 11.32 -4 0 11.85 -4 0
0
0 BFC INVERTNEXT
1 16 20.05 -4 0 -5.80 0 -5.80 0 4 0 5.80 0 -5.80 1-4cyli.dat
1 16 20.05 0 0 -5.80 0 -5.80 0 1 0 5.80 0 -5.80 1-4edge.dat
1 16 20.05 -4 0 -5.80 0 -5.80 0 1 0 5.80 0 -5.80 1-4edge.dat
0

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Fri, 15 Aug 2003 14:01:05 GMT
Viewed: 
3075 times
  

In lugnet.cad.dat.parts.primitives, Mark Kennedy wrote:
I recently reworked the stud 5 primitive to make use of more quarter
cylinders.  I then noticed that when viewed there were edge lines
apearing where they shouldn't. If you look at the primitive from
various points you can see this occur.

Ahh, the dreaded S-curve cylinder join rears it's ugly head again.
I voted to ignore this a while back and gave my reasons.

http://news.lugnet.com/cad/dev/?n=7192

Nobody disagreed at the time.

Don

   
         
     
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Sat, 16 Aug 2003 05:54:50 GMT
Viewed: 
3110 times
  

Ahh, the dreaded S-curve cylinder join rears it's ugly head again.
I voted to ignore this a while back and gave my reasons.

http://news.lugnet.com/cad/dev/?n=7192

Nobody disagreed at the time.

Don

So the problem could be solved by using high res primitives?
I'll have to try that out.

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Sun, 17 Aug 2003 18:03:31 GMT
Viewed: 
3147 times
  

In lugnet.cad.dat.parts.primitives, Don Heyse wrote:
In lugnet.cad.dat.parts.primitives, Mark Kennedy wrote:
I recently reworked the stud 5 primitive to make use of more quarter
cylinders.  I then noticed that when viewed there were edge lines
apearing where they shouldn't. If you look at the primitive from
various points you can see this occur.

Ahh, the dreaded S-curve cylinder join rears it's ugly head again.
I voted to ignore this a while back and gave my reasons.

http://news.lugnet.com/cad/dev/?n=7192

Nobody disagreed at the time.

Is there a reason that the cylinder primitives haven't been updated to work like
the sphere primitive?  As long as there are type 5 lines on both ends of each
partial cylinder, and the control point out in space is tangent to the cylinder
instead of being at the next point on the cylinder approximation, the problem
goes away.

It's kind of difficult to explain, but the two joining type 5 lines cooperate to
product correct rendering when two cylinders are connected, and it gets rid of
this problem on S-curves and when cylinders are joined to non-cylinders (say if
you want to have a rounded corner).  LDView actually does this when it uses
primitive substitution on cylinder primitives, and the phantom line doesn't
appear.

This was discussed here:

http://news.lugnet.com/cad/dev/?n=7176

Note that it's tough to understand at first; you may have to read a large part
of the thread, but the article I linked to has the short description.  My vote
would be to update the partial cylinder primitives.  Note that the partial
sphere primitive is already coded in this way; I'm not sure why the partial
cylinder primitives aren't.

--Travis Cobbs

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Sun, 17 Aug 2003 19:26:35 GMT
Viewed: 
3261 times
  

In lugnet.cad.dat.parts.primitives, Travis Cobbs wrote:
In lugnet.cad.dat.parts.primitives, Don Heyse wrote:
In lugnet.cad.dat.parts.primitives, Mark Kennedy wrote:
I recently reworked the stud 5 primitive to make use of more quarter
cylinders.  I then noticed that when viewed there were edge lines
apearing where they shouldn't. If you look at the primitive from
various points you can see this occur.

Ahh, the dreaded S-curve cylinder join rears it's ugly head again.
I voted to ignore this a while back and gave my reasons.

http://news.lugnet.com/cad/dev/?n=7192

Nobody disagreed at the time.

Is there a reason that the cylinder primitives haven't been updated to work like
the sphere primitive?  As long as there are type 5 lines on both ends of each
partial cylinder, and the control point out in space is tangent to the cylinder
instead of being at the next point on the cylinder approximation, the problem
goes away.

I don't think the S curve problem goes away.  The tangent control point
works perfectly for two (same radius) curves that both curl in the same
direction.  It also works perfectly for a curve joining a flat edge
along the tangent.

However it only reduces the problem (by half) for two curves joined
in an S shape.  However with your fix, the problem also approches
0 as the number of segments in the curve approaches infinity.  I think
it's good enough for low res curves when used for tiny geometry like
studs, and good enough with the higher resolution curves for larger
bits.

So if the primitives haven't been updated with the tangent control
points at the ends, they should be.

Any volunteers?

.  My vote

And mine.

would be to update the partial cylinder primitives.  Note that the partial
sphere primitive is already coded in this way; I'm not sure why the partial
cylinder primitives aren't.

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Thu, 2 Oct 2003 03:14:23 GMT
Viewed: 
3272 times
  

In lugnet.cad.dat.parts.primitives, Don Heyse wrote:
In lugnet.cad.dat.parts.primitives, Travis Cobbs wrote:
In lugnet.cad.dat.parts.primitives, Don Heyse wrote:
In lugnet.cad.dat.parts.primitives, Mark Kennedy wrote:
I recently reworked the stud 5 primitive to make use of more quarter
cylinders.  I then noticed that when viewed there were edge lines
apearing where they shouldn't. If you look at the primitive from
various points you can see this occur.

Ahh, the dreaded S-curve cylinder join rears it's ugly head again.
I voted to ignore this a while back and gave my reasons.

http://news.lugnet.com/cad/dev/?n=7192

Nobody disagreed at the time.

Is there a reason that the cylinder primitives haven't been updated to work like
the sphere primitive?  As long as there are type 5 lines on both ends of each
partial cylinder, and the control point out in space is tangent to the cylinder
instead of being at the next point on the cylinder approximation, the problem
goes away.

I don't think the S curve problem goes away.  The tangent control point
works perfectly for two (same radius) curves that both curl in the same
direction.  It also works perfectly for a curve joining a flat edge
along the tangent.

However it only reduces the problem (by half) for two curves joined
in an S shape.  However with your fix, the problem also approches
0 as the number of segments in the curve approaches infinity.  I think
it's good enough for low res curves when used for tiny geometry like
studs, and good enough with the higher resolution curves for larger
bits.

So if the primitives haven't been updated with the tangent control
points at the ends, they should be.

Any volunteers?

.  My vote

And mine.

would be to update the partial cylinder primitives.  Note that the partial
sphere primitive is already coded in this way; I'm not sure why the partial
cylinder primitives aren't.
Ok... I'm a bit lost is all this mess.
I need to know where we stand on this issue. I have a Primitive Generator
program written with Visual Basic available for people to download and use. If I
have handled this incorrecly, I need to know so I can try to fix the program.

I brought this up again, since I was reviewing my previous votes on the Parts
Tracker;
http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=p/1-16cyli.dat

Paul

If you would like to try out the Primitive Generator, it can be downloaded from
this page;
http://www.geocities.com/pneaster/prim-gen.htm

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Thu, 2 Oct 2003 03:39:36 GMT
Viewed: 
3337 times
  

In lugnet.cad.dat.parts.primitives, Paul Easter wrote:

... “mess” ... deleted :-)

   Ok... I’m a bit lost is all this mess. I need to know where we stand on this issue. I have a Primitive Generator program written with Visual Basic available for people to download and use. If I • have handled this incorrecly, I need to know so I can try to fix the program.

I brought this up again, since I was reviewing my previous votes on the Parts Tracker; http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=p/1-16cyli.dat

Paul

If you would like to try out the Primitive Generator, it can be downloaded from • this page; http://www.geocities.com/pneaster/prim-gen.htm

I believe the consensus was that the line between the last edge and the control point hanging out in space should be tangent to the cylinder, that this will help cases where the cylinder meets a box at right angles, and that it will help (but not fix) the S-curve problem.

So, on a quarter cylinder, the line (which of course wouldn’t be drawn) between the edge of the cylinder and the control point in space is represented by the red lines in this diagram:



With the above style type 5 lines, you have to have a type 5 line at both ends, or it won’t work right (hence the two red lines). I’m not sure if I’m describing this well.

I’m not sure we got a consensus about doing things like the above, but on the other hand, I don’t think anyone objected.

--Travis Cobbs

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Thu, 2 Oct 2003 04:09:45 GMT
Viewed: 
3383 times
  

In lugnet.cad.dat.parts.primitives, Travis Cobbs wrote:
   In lugnet.cad.dat.parts.primitives, Paul Easter wrote:

... “mess” ... deleted :-)

   Ok... I’m a bit lost is all this mess. I need to know where we stand on this issue. I have a Primitive Generator program written with Visual Basic available for people to download and use. If I have handled this incorrecly, I need to know so I can try to fix the program.

I brought this up again, since I was reviewing my previous votes on the Parts Tracker; http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=p/1-16cyli.dat

Paul

If you would like to try out the Primitive Generator, it can be downloaded from this page; http://www.geocities.com/pneaster/prim-gen.htm

I believe the consensus was that the line between the last edge and the control point hanging out in space should be tangent to the cylinder, that this will help cases where the cylinder meets a box at right angles, and that it will help (but not fix) the S-curve problem.

So, on a quarter cylinder, the line (which of course wouldn’t be drawn) between the edge of the cylinder and the control point in space is represented by the red lines in this diagram:



With the above style type 5 lines, you have to have a type 5 line at both ends, or it won’t work right (hence the two red lines). I’m not sure if I’m describing this well.

I’m not sure we got a consensus about doing things like the above, but on the other hand, I don’t think anyone objected.

--Travis Cobbs
That’s what I was afraid of... That is not how I handled it in the program. So, now this should apply for any segment files, right? 1-16,1-8,3-16,1-4,7-48, etc? If so, I will have to rethink how to calculate those points.

now... this brings us to the next area.... this also applies to cones, right? IIRC, I use the same procedure for conditional lines for both cylinders and cones, with minor changes.

Paul.

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Fri, 3 Oct 2003 03:16:49 GMT
Viewed: 
3407 times
  

In lugnet.cad.dat.parts.primitives, Paul Easter wrote:
   That’s what I was afraid of... That is not how I handled it in the program. So, now this should apply for any segment files, right? 1-16,1-8,3-16,1-4,7-48, etc? If so, I will have to rethink how to calculate those points.

now... this brings us to the next area.... this also applies to cones, right? IIRC, I use the same procedure for conditional lines for both cylinders and cones, with minor changes.

I think ideally this would be used on all segmented primitives that are circular and not flat (obviously it doesn’t apply to primitives like disks and rings). So think that the same logic would apply to cones. Incidentally, I think the 1/8 spheres were the first primitives to use this style.

Having said that, I think having primitives that do things the “old” way is fine. It may not be optimal, but I don’t personally think it is all that bad, either.

--Travis Cobbs

   
         
   
Subject: 
Re: Stud5 and type 5 lines at edge of cylinders.
Newsgroups: 
lugnet.cad.dat.parts.primitives
Date: 
Wed, 8 Oct 2003 02:24:03 GMT
Viewed: 
3748 times
  

In lugnet.cad.dat.parts.primitives, Travis Cobbs wrote:
   In lugnet.cad.dat.parts.primitives, Paul Easter wrote:
   That’s what I was afraid of... That is not how I handled it in the program. So, now this should apply for any segment files, right? 1-16,1-8,3-16,1-4,7-48, etc? If so, I will have to rethink how to calculate those points.

now... this brings us to the next area.... this also applies to cones, right? IIRC, I use the same procedure for conditional lines for both cylinders and cones, with minor changes.

I think ideally this would be used on all segmented primitives that are circular and not flat (obviously it doesn’t apply to primitives like disks and rings). So think that the same logic would apply to cones.
Ok, so... that could also mean torii as well... again, the primitive generator and past spreadsheets do this the “old” way. I will have to look into that as well.

   Incidentally, I think the 1/8 spheres were the first primitives to use this style.
I believe you are correct.

  
Having said that, I think having primitives that do things the “old” way is fine. It may not be optimal, but I don’t personally think it is all that bad, either.
I agree. Should I make this an option on the primitve generator? If so, what would I call it in the options menu, and which would be default?

Paul Easter

For details on the “Primitive Generator” program;

http://www.geocities.com/pneaster/prim-gen.htm





 

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR