[cad-linux-dev] Re: bumpy polylines

  • From: Eric Wilhelm <ewilhelm@xxxxxxxxxxxxx>
  • To: cad-linux-dev@xxxxxxxxxxxxx
  • Date: Sun, 17 Oct 2004 10:26:01 -0500

# The following was supposedly scribed by
# Dave Coventry
# on Sunday 17 October 2004 04:37 am:

>What I did was have a link field which would allow one CAD entity to
> be part of another.
>
>So, for example, your polyline would describe the first section,
> then link tothe arc, then link back to the remainder of the
> polyline. Ostensibly this would describe one entity.

I don't think the seg,arc,seg,seg,arc scheme plays as well as 
pt,pt,pt,pt,pt,pt & no,arc,no,no,arc.  With the latter, it is 
actually possible to ignore the arcs and just draw the polyline 
between points.

I think using links might be okay, but I don't want to get too 
relational with this format.  Think of a simple program which just 
draws all of the ./*.yml entities to the screen.  Everything under 
this typeglob should be drawable.  So, if you have a polyline which 
links to an arc ./10.yml, you get an arc drawn in addition to the one 
which is part of the polyline.

Of course, as long as the link is there, it looks exactly the same as 
that part of the polyline, but it appears as two entities unless you 
specifically program around it.

This is exactly the same as the situation with clipped images and 
viewports.  Referenced entities are either links or embedded.

Linked:
--- # 9.yml
...
bumps:
  - ~
  - ~
  - 10.yml
  - ~
  - 11.yml

Embedded:
--- # 9.yml
...
bumps:
  - ~
  - ~
  - angles:
      - float # starting angle (radians)
      - float # ending angle (radians)
    points:
      -
        - float # x
        - float # y
        - float # z (optional)
    radius: float
    type: arc
  - ~
  ...

Now, if you embed the arc, you can skip the geometric_shared 
properties (color, linetype, etc.)  But if you link to it, the 10.yml 
file *has* to have those properties or it would be invalid.  Linking 
opens the issue where the arc could have a different color than the 
polyline, and this makes things difficult for simple programs.

I'm really not so sure that rhizopod should have links at all.  
Remember that the goal is to create a format that makes it easy to 
manipulate drafting and simple model data.

Let's consider a command-line 'move' program.

  move 20 30 *.yml

If this were to follow the link while moving the polyline, it would 
move the arc twice.  But, if it doesn't follow the link, this call 
(moving just the polyline) would leave the arc un-moved:

  move 20 30 9.yml

Both cases invalidate the polyline.  So does moving 10.yml (the arc) 
by itself.

With the arc embedded in the polyline entity, these issues go away.

Simply using the "bump" factor accomplishes this too, but requires 
every program to evaluate the bump into an arc.  With a pre-evaluated 
bump, it can just be manipulated and queried as an arc.

--Eric
-- 
"When the going gets tough, most people quit."
                                        --Unknown

Other related posts: