POV-Ray : Newsgroups : povray.binaries.utilities : PointWriter: New app for making spline-based shapes easily Server Time
31 Oct 2024 08:18:53 EDT (-0400)
  PointWriter: New app for making spline-based shapes easily (Message 1 to 10 of 28)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Nevado
Subject: PointWriter: New app for making spline-based shapes easily
Date: 13 Sep 2014 03:35:02
Message: <web.5413f2e5dd5e1c786dce1a360@news.povray.org>
See povray.news-submissions for details


Post a reply to this message


Attachments:
Download 'pointwriter.zip' (1219 KB)

From: Bald Eagle
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 13 Sep 2014 11:05:01
Message: <web.54145bfc9ace5295e7df57c0@news.povray.org>
"Nevado" <nomail@nomail> wrote:
> See povray.news-submissions for details

Hi Christian,
Thanks for putting this together - it looks like a useful tool and a nice
complement to existing utilities.

I've really only just started modeling objects using spline-based primitives, so
I may have "problems" that - aren't, or solutions for problems that don't exist.

I'm giving it a go now, and I'll just write out my observations and thoughts.

Running Windows XP on an Acer Aspire One with 2GB.

===================================================
Issues and request for help:

The executable appears to be "always on top", and overrides my taskbar, so I
have to minimize it to switch between windows.

I tried making several cubic prisms, and I ran into some issues.
at first, I just clicked "close poly" because not enough coffee had been
absorbed yet.  This does not play well with Write Cubic Prism.
Perhaps you could add a bit of insight about what to do if I close a spline for
one purpose, and then reload it, but want to use it for another purpose.

When the SDL for the spline points is written, it might be helpful for keeping
track, editing, and debugging to add a few comments into the mix. (Prism not
closed, too few points, etc.)

prism {
cubic_spline 0, 1, 12345,
<A, B, C>, // Control Point
<D, E, F>, // First Point
..........,
<U, V, W>, // Last Point
<X, Y, Z>  // Control Point
}

[A trick I use sometimes to "highlight" certain values is to just enclose them
in parentheses:  <0, (3.14159), 1> - maybe that could be done in addition to /
in lieu of //comments.]

Red dots on a red spline are hard to see.
Maybe it was just me, but it seemed sometimes that a point was inserted a bit
off from where I actually clicked.

It appears that once I close a prism, I can begin drawing a new one.
How do I select(?) / move / edit the previous one?

Would it be possible to cycle a color value for the current object being drawn?
(1st prism red, 2nd green, 3rd blue, etc.)

When I tried to edit a prism, the points all disappeared!
I hit M to get rid of the background graphic I was tracing, and then I saw a
single green point - that's it.
When Writing an object, the background graphic disappears. Is that intended
behaviour?

Can I INSERT points into an existing spline?

=============================================
Suggestions for additional features, food for thought:

Addition of exported SDL for sweep primitives?

I'd like to be able to translate, rotate, and align items after the fact.
Some things I thought might be useful would be:

The ability to select a point and then have a button that redefines all the
prism/lathe coordinates with the selected point at the origin.  Now since I know
the reference point, I can rotate, translate, and align things a lot more
easily.

Being able to insert reference points or whole CSG objects.
Since I'm drawing things "in cross section", it would be useful to be able to
insert points as references for later elaboration.

Suppose I wanted to make "part" and have a certain point line up with something
in a large SDL file.  It would be useful to be able to click/make a solo
floating point, which could just be exported as "#declare Ref_Point_1 = <x, y,
z>"
[Picture a connecting rod (O)---(O).  If I define one side as being at the
origin, then having another point defined as a reference would allow me to
trivially align some other origin-reference-point by translating to that
reference point.  "object {ConnectingRod translate <x, y, z>}"


If I wanted to subtract a hole at that point, it would be useful to define that
point as the ends of a cylinder going from y = -0.1 to 1.1.  That way it's big
enough to see in a union, or avoid coincident surfaces in a difference.

If I wanted a sphere there, I could use the reference point as its center, or
you could just export the sphere definition directly. I suppose a clever way to
insert a box would be useful as well, using the diagonal to define the
dimensions...

=================================

Thanks again for developing this utility, and I'll keep playing with it to see
how it works.  I especially like the background graphic, the "Work in Back"
feature, and the ability to draw perfectly straight vertical and horizontal
lines!


Post a reply to this message

From: Nevado
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 13 Sep 2014 14:20:01
Message: <web.54148a159ace5296dce1a360@news.povray.org>
> Hi Christian,
> Thanks for putting this together - it looks like a useful tool and a nice
> complement to existing utilities.


Glad to hear it.


>
> I've really only just started modeling objects using spline-based primitives, so
> I may have "problems" that - aren't, or solutions for problems that don't exist.
>
> I'm giving it a go now, and I'll just write out my observations and thoughts.
>
> Running Windows XP on an Acer Aspire One with 2GB.
>
> ===================================================
> Issues and request for help:
>
> The executable appears to be "always on top", and overrides my taskbar, so I
> have to minimize it to switch between windows.
>
> I tried making several cubic prisms, and I ran into some issues.
> at first, I just clicked "close poly" because not enough coffee had been
> absorbed yet.  This does not play well with Write Cubic Prism.
> Perhaps you could add a bit of insight about what to do if I close a spline for
> one purpose, and then reload it, but want to use it for another purpose.



stores them in an array (where one dimension also keeps track of subprisms or
subpolys). The screen points are not translated into POV-Ray scene language

write them as different shapes, if you want.


> When the SDL for the spline points is written, it might be helpful for keeping
> track, editing, and debugging to add a few comments into the mix. (Prism not
> closed, too few points, etc.)



be other warnings.


cubic prism you must close it before writing.


> prism {
> cubic_spline 0, 1, 12345,
> <A, B, C>, // Control Point
> <D, E, F>, // First Point
> ..........,
> <U, V, W>, // Last Point
> <X, Y, Z>  // Control Point
> }
>
> [A trick I use sometimes to "highlight" certain values is to just enclose them
> in parentheses:  <0, (3.14159), 1> - maybe that could be done in addition to /
> in lieu of //comments.]
>
> Red dots on a red spline are hard to see.


You may have a point. That would be easy to change.


> Maybe it was just me, but it seemed sometimes that a point was inserted a bit
> off from where I actually clicked.




off by pressing 0, and then you can put your points anywhere.


> It appears that once I close a prism, I can begin drawing a new one.




the next. This is all explained in the PointWriterHelp.txt file.)


> How do I select(?) / move / edit the previous one?


When you click close enough to a point, it will be recognized as the one you
want to edit and turn green. It will then be replaced by the next point you
write.
If you click too far from any point, a new point will simply be added to the



> Would it be possible to cycle a color value for the current object being drawn?
> (1st prism red, 2nd green, 3rd blue, etc.)





> When I tried to edit a prism, the points all disappeared!
> I hit M to get rid of the background graphic I was tracing, and then I saw a
> single green point - that's it.
> When Writing an object, the background graphic disappears. Is that intended
> behaviour?
>
> Can I INSERT points into an existing spline?
>


No, you can move any single point anywhere and delete them from the last point
backward, but not insert new points (except at the end, of course).


> =============================================
> Suggestions for additional features, food for thought:
>
> Addition of exported SDL for sweep primitives?
>
> I'd like to be able to translate, rotate, and align items after the fact.


You cannot rotate the shape on screen, but you can move it left, right, up or
down in the grid at any time (in jumps of 0.25 units) by using the F1,F2,F3 and
F4 keys. You can actually move it all the way out of the screen to get more
drawing space, and it will still be there, ready to be moved back in.


> Some things I thought might be useful would be:
>
> The ability to select a point and then have a button that redefines all the
> prism/lathe coordinates with the selected point at the origin.  Now since I know
> the reference point, I can rotate, translate, and align things a lot more
> easily.


Well, you can center the Y and/or X-axis and so choose between origin at screen
center, center bottom, center left or bottom left. And then you can move your
shape anywhere in relation to the origin with the F1-F4 keys as described above,
so you can basically get what you want.


> Being able to insert reference points or whole CSG objects.
> Since I'm drawing things "in cross section", it would be useful to be able to
> insert points as references for later elaboration.



always insert previously saved work as background or reference for drawing new



> Suppose I wanted to make "part" and have a certain point line up with something
> in a large SDL file.  It would be useful to be able to click/make a solo
> floating point, which could just be exported as "#declare Ref_Point_1 = <x, y,
> z>"
> [Picture a connecting rod (O)---(O).  If I define one side as being at the
> origin, then having another point defined as a reference would allow me to
> trivially align some other origin-reference-point by translating to that
> reference point.  "object {ConnectingRod translate <x, y, z>}"
>
>
> If I wanted to subtract a hole at that point, it would be useful to define that
> point as the ends of a cylinder going from y = -0.1 to 1.1.  That way it's big
> enough to see in a union, or avoid coincident surfaces in a difference.
>
> If I wanted a sphere there, I could use the reference point as its center, or
> you could just export the sphere definition directly. I suppose a clever way to
> insert a box would be useful as well, using the diagonal to define the
> dimensions...
>
> =================================
>
> Thanks again for developing this utility, and I'll keep playing with it to see
> how it works.  I especially like the background graphic, the "Work in Back"
> feature, and the ability to draw perfectly straight vertical and horizontal
> lines!


Good to hear - and thanks for the feedback!


Post a reply to this message

From: Nevado
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 14 Sep 2014 08:10:02
Message: <web.5415844c9ace5296dce1a360@news.povray.org>
Thanks to Bald Eagle for pointing out some bugs in my 1.0 version of
PointWriter.
This version 1.1 has the following fixes:

* Object points tend to blend in with connecting lines. Points are made larger.
* Background image disappears when writing points. Subroutine jump corrected.
* Drawn objects disappear when editing while using background image. Subroutine
jump corrected.


Post a reply to this message


Attachments:
Download 'pointwriter.zip' (1219 KB)

From: Bald Eagle
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 14 Sep 2014 09:05:00
Message: <web.541592459ace5295e7df57c0@news.povray.org>
I downloaded it and copied POVpoint.txt to the new directory.
Clicked on Reload Work

got:

Please Note:
(!)  #grid
These handles closed by Just BASIC.
Please add the appropriate CLOSE commands.
[OK]

Clicking OK, I get:

Warning
Runtime Error:  OS Error: The system cannot find the file specified.
(see error.log for more information)
[OK]


I was trying to follow the code last night, but it was late and my eyes were
ready to bleed.  ;)  I thought I noticed a few odd subroutine terminations, but
I'm not familiar with what Just BASIC requires, so maybe not everything needs an
endif, etc.

Attached is the log file.

Following that is your original file with some indentations, etc.
Maybe that will help you look it over once more and spot things more quickly,
since it will take me a little while to read the JB docs and familiarize myself
with the syntax and conventions.


Post a reply to this message


Attachments:
Download 'error.log.txt' (3 KB)

From: Bald Eagle
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 14 Sep 2014 09:10:00
Message: <web.541592929ace5295e7df57c0@news.povray.org>
Edited original:


Post a reply to this message


Attachments:
Download 'pointwriter_edit.bas.txt' (43 KB)

From: Nevado
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 14 Sep 2014 11:35:00
Message: <web.5415b48d9ace5296dce1a360@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> I downloaded it and copied POVpoint.txt to the new directory.
> Clicked on Reload Work
>
> got:
>
> Please Note:
> (!)  #grid
> These handles closed by Just BASIC.
> Please add the appropriate CLOSE commands.
> [OK]
>
> Clicking OK, I get:
>
> Warning
> Runtime Error:  OS Error: The system cannot find the file specified.
> (see error.log for more information)
> [OK]


The file containing your work is not "POVpoints.txt", but "Work.txt".


Post a reply to this message

From: Bald Eagle
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 14 Sep 2014 21:55:00
Message: <web.5416465f9ace5295e7df57c0@news.povray.org>
> The file containing your work is not "POVpoints.txt", but "Work.txt".

Right, I got that.  Somehow I must have wiped out my Work file and all I had to
transfer to the new directory was povpoints.

Anyway,

Is there a way to test if a file exists before trying to open it?

I noticed that the line often disappears when I click on EDIT.
Adding the following line seems to fix that.
(Also - you had the code make the point turn dark green.  My change redraws the
point as default.  What was the purpose of the dark green coloring?)

if Edit = 1 then
    #grid, "size 5 ; font Arial 20 bold ; color green ; backcolor white ; place
";800*WF;" ";80*HF;" ;\EDIT"
    #grid, "size 2 ; font Arial ";Font1;" bold ; color darkgreen ; backcolor
white ; place ";400*WF;" ";725*HF;" ;\Click point to be edited"
    Edit = 2
    goto [skipline]                         ' Added to redraw line - BW
    goto [nextpoint]
end if

As it stands, once EDIT is selected, there's no way to exit EDIT mode.
I'm thinking that instead of Edit = 1, make it Edit = (Edit-1)^2
0-1 squared = 1, 1-1 squared = 0.  Toggled.

As I seem to be good at breaking things, I also noticed when experimenting with
Edit, that I can move points to be coincident.  I haven't gone through the
code/logic, but it seems that selecting a point at those coordinates would
select the point earliest on the spline.  An interesting situation to think
about.

I've made a few other changes - just playing around with the formatting of the
axis labels and the menu to learn how the screen coordinates work, etc.
                          See what you think. :)
Thanks again, so much for writing this - It's been ages since I've programmed in
BASIC (!), and it brings me WAY back.
I've had lots of fun fiddling and translating the Danish commetary.  :D

Which reminds me:
The best I can translate "DETTE ER I SKOVEN" into English is "THIS IS IN THE
FOREST"   Is that some sort of phrase with another meaning? (idiosyncratic?)
Like "You have a bird" means "You're crazy" in German? (Du hast ein vogel)

Thanks again Christian.


Post a reply to this message


Attachments:
Download 'pointwriter_edit.bas.txt' (48 KB)

From: Le Forgeron
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 15 Sep 2014 03:45:49
Message: <5416992d$1@news.povray.org>
Le 14/09/2014 14:04, Nevado a écrit :
> Thanks to Bald Eagle for pointing out some bugs in my 1.0 version of
> PointWriter.
> This version 1.1 has the following fixes:
> 
> * Object points tend to blend in with connecting lines. Points are made larger.
> * Background image disappears when writing points. Subroutine jump corrected.
> * Drawn objects disappear when editing while using background image. Subroutine
> jump corrected.
> 
It looks great... can we have it in Java for a system-independent solution ?

The idea of intersecting two prisms never hit me before, yet so obvious!

I want it! (but I'm not on Windows at home :-/ )

-- 
Just because nobody complains does not mean all parachutes are perfect.


Post a reply to this message

From: Nevado
Subject: Re: PointWriter: New app for making spline-based shapes easily
Date: 15 Sep 2014 05:20:00
Message: <web.5416acd69ace5296dce1a360@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
> > The file containing your work is not "POVpoints.txt", but "Work.txt".
>
> Right, I got that.  Somehow I must have wiped out my Work file and all I had to
> transfer to the new directory was povpoints.
>
> Anyway,
>
> Is there a way to test if a file exists before trying to open it?



you have saved work.
Besides, it will be in the PointWriter folder, easy to spot.


> I noticed that the line often disappears when I click on EDIT.
> Adding the following line seems to fix that.


That would be fixed in the new version 1.1, uploaded yesterday.


> (Also - you had the code make the point turn dark green.  My change redraws the
> point as default.  What was the purpose of the dark green coloring?)


The selected point turns green to show the user exactly which one will be
replaced by the next click.
Useful, I think. The color changes back when the point is replaced.


> if Edit = 1 then
>     #grid, "size 5 ; font Arial 20 bold ; color green ; backcolor white ; place
> ";800*WF;" ";80*HF;" ;\EDIT"
>     #grid, "size 2 ; font Arial ";Font1;" bold ; color darkgreen ; backcolor
> white ; place ";400*WF;" ";725*HF;" ;\Click point to be edited"
>     Edit = 2
>     goto [skipline]                         ' Added to redraw line - BW
>     goto [nextpoint]
> end if
>
> As it stands, once EDIT is selected, there's no way to exit EDIT mode.
> I'm thinking that instead of Edit = 1, make it Edit = (Edit-1)^2
> 0-1 squared = 1, 1-1 squared = 0.  Toggled.




If I should make one, I would use Edit = 1-Edit and check for the values 0 and
1, like I did with the grid colours. A tiny bit simpler.


> As I seem to be good at breaking things, I also noticed when experimenting with
> Edit, that I can move points to be coincident.  I haven't gone through the
> code/logic, but it seems that selecting a point at those coordinates would
> select the point earliest on the spline.  An interesting situation to think
> about.
>
> I've made a few other changes - just playing around with the formatting of the
> axis labels and the menu to learn how the screen coordinates work, etc.
>                           See what you think. :)


I thought about giving the points and lines different colours, but stuck with
red for optimum contrast with the background. I did make the points a little
larger in the 1.1 version, though.

the blue grid.
Your changes are mostly a matter of taste, I guess. If they work for you, fine.


> Thanks again, so much for writing this - It's been ages since I've programmed in
> BASIC (!), and it brings me WAY back.
> I've had lots of fun fiddling and translating the Danish commetary.  :D

:-)


> Which reminds me:
> The best I can translate "DETTE ER I SKOVEN" into English is "THIS IS IN THE
> FOREST"   Is that some sort of phrase with another meaning? (idiosyncratic?)
> Like "You have a bird" means "You're crazy" in German? (Du hast ein vogel)


That was a note to myself during programming, basically (no pun intended)




> Thanks again Christian.



Tip: Use the keyboard shortcuts. You can work much faster. And study the


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.