Jump to content




The versatile Shape Builder (updated 05/08/14 - now with diagonal lines)

turtle utility

143 replies to this topic

#41 Keridos

  • Members
  • 75 posts

Posted 04 May 2013 - 09:20 AM

View PostKravyn, on 03 May 2013 - 12:32 AM, said:

yeah got it working just not repeatable but is there a way to repeat the square command like I posted?
I'll leave that question to Happydude as he wrote that system and I currently have a bit other things to do (Writing the Xycraft Wiki, updating my private server and some other things).

#42 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 05 May 2013 - 10:12 PM

View PostKravyn, on 03 May 2013 - 12:32 AM, said:

yeah got it working just not repeatable but is there a way to repeat the square command like I posted?
shell.run("scriptName", "square", "sideLength", "-z")
shell.run("scriptName", "square", "sideLength", "-z")
Just run the program twice from a different script
(sorry about the late reply, with finals soon I have been forgetting to check out the forums)

#43 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 08 May 2013 - 07:02 AM

For example if you wanted to build a 20x20 square centered on top of a 10x10 you would use
shell.run("shape", "square", "10", "-z")
for i = 1 , 5 do
	turtle.back()
end
turtle.turnRight()

for i = 1 , 5 do
	turtle.back()
end
turtle.turnLeft()
turtle.up()
shell.run("shape", "square", "20")


#44 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 08 May 2013 - 07:06 AM

One thing I should probably mention is that -z was more intended for spheres/domes/bowls/circles/cylinders but then works with all of the other shapes. Try out the script on a smaller version of the shape to know how -z effects that shape.

#45 Fronts

  • New Members
  • 1 posts

Posted 11 May 2013 - 10:06 AM

I can't get this to place blocks in Lite 0.6.5 but it worked a charm in 0.6.1, any help?

#46 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 12 May 2013 - 12:52 AM

View PostFronts, on 11 May 2013 - 10:06 AM, said:

I can't get this to place blocks in Lite 0.6.5 but it worked a charm in 0.6.1, any help?
What mod pack are you referring to?

#47 uberadiant

  • Members
  • 5 posts

Posted 14 May 2013 - 11:04 AM

Hi guys, I've been following this for a little while but I have to point something out.

The circles that the turtle builds aren't very...umm, well, round. I understand that this code has come from another program but I think it should be mentioned (there is a pic below to illustrate this). I'm building a Star Trek museum world so as you can imagine, circles and ellipses have to be spot on for there to be any semblance of accuracy. Not sure if it's something that anyone feels is worth fixing, but thought I would point it out anyway. The various sphere generators available online all render circles almost perfectly, depending on the radius obviously. However, when I'm trying to create circles with radii of dozens or hundreds of metres, building them manually is both extremely tedious and horrifically time consuming.


Please don't take this is a criticism of anyone's work! The fact that you guys create these programs for others to use is great! I'm just being picky :P

Spoiler


#48 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 14 May 2013 - 06:07 PM

View Postuberadiant, on 14 May 2013 - 11:04 AM, said:

Hi guys, I've been following this for a little while but I have to point something out.

The circles that the turtle builds aren't very...umm, well, round. I understand that this code has come from another program but I think it should be mentioned (there is a pic below to illustrate this). I'm building a Star Trek museum world so as you can imagine, circles and ellipses have to be spot on for there to be any semblance of accuracy. Not sure if it's something that anyone feels is worth fixing, but thought I would point it out anyway. The various sphere generators available online all render circles almost perfectly, depending on the radius obviously. However, when I'm trying to create circles with radii of dozens or hundreds of metres, building them manually is both extremely tedious and horrifically time consuming.


Please don't take this is a criticism of anyone's work! The fact that you guys create these programs for others to use is great! I'm just being picky :P

Spoiler
Thanks for the criticism, alert. :) I have been working on trying to optimise this in my free time (when I'm not working on new stuff for this program) but all of my attempts have failed. The method we use to generate circles is to go block by block and determine how far away the center of that block is from the center of the circle/sphere. If that distance is in the range between the radius and the radius plus the square root of 3, the program places a block there. I personally don't know exactly why we add on the square root of 3 but when I try smaller values it leave holes and larger values create overlap. (in my tests at least) There are other parameters that I haven't tested yet. Like right now we only do the radius check on the center of the block, we could try different points (closer/farther to the center). What if we used points closer to the center the closer we get to 45° from the x or z axis. There is a lot more that I have yet to try. This isn't very high on my priorities right now though, because it works and I have yet to see a case where it doesn't meet the goals, so "If it ain't broke, don't fix it." is sort of taking effect for me. I do agree though that smaller circles could look more circular. You are always welcome to take a look at the source code on github and see if there is anything you can do about it ;) I will move this up my personal priority list though since I've seen a few people mention this.

#49 uberadiant

  • Members
  • 5 posts

Posted 15 May 2013 - 06:35 AM

Thanks for the reply :)

I understand it's not a particularly important issue, and please don't make this a priority over anything else you might be doing. As I said, I'm just really picky. Admittedly, I've only tried it using circles with relatively small radii. I haven't attempted to create 100m radius circles or anything like that yet (the idea of waiting ages for the turtle to do it's thing to only then find out it's not exactly to my ridiculously pedantic standards and have to destroy it...me no likey that thought).

As for me trying to alter the code...I used to be a barely competent programmer, but to be honest it's something that I find a bit boring, so I'll leave it to the experts! If I could maybe make a (possibly silly) suggestion, maybe have a look at the online circle/sphere generators and see if you can see at a glance how they do the maths. Just a thought, and only if you think it might help, of course :)

Thanks for having a look at it though, I appreciate it a lot :)

#50 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 16 May 2013 - 11:39 PM

View Postuberadiant, on 15 May 2013 - 06:35 AM, said:

Thanks for the reply :)

I understand it's not a particularly important issue, and please don't make this a priority over anything else you might be doing. As I said, I'm just really picky. Admittedly, I've only tried it using circles with relatively small radii. I haven't attempted to create 100m radius circles or anything like that yet (the idea of waiting ages for the turtle to do it's thing to only then find out it's not exactly to my ridiculously pedantic standards and have to destroy it...me no likey that thought).

As for me trying to alter the code...I used to be a barely competent programmer, but to be honest it's something that I find a bit boring, so I'll leave it to the experts! If I could maybe make a (possibly silly) suggestion, maybe have a look at the online circle/sphere generators and see if you can see at a glance how they do the maths. Just a thought, and only if you think it might help, of course :)

Thanks for having a look at it though, I appreciate it a lot :)
Thanks for the suggestion. May I ask which online generator you used for your circle on the right? Also the radius used, I'm pretty sure it's 6, but I want to be sure.

Edited by happydude11209, 16 May 2013 - 11:44 PM.


#51 uberadiant

  • Members
  • 5 posts

Posted 17 May 2013 - 10:43 AM

I use the following -

http://oranj.io/blog...SphereGenerator

http://www.plotz.co.uk/plotz.php

http://donatstudios....CircleGenerator


I had a very quick look at the source for the third one. There's a link to a github repository, and the code for the generator is there. Also, the licence seems to indicate that it is open source, so could be useful! And you're right, the radius I used was 6.

#52 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 19 May 2013 - 08:10 PM

View Postuberadiant, on 17 May 2013 - 10:43 AM, said:

I use the following -

http://oranj.io/blog...SphereGenerator

http://www.plotz.co.uk/plotz.php

http://donatstudios....CircleGenerator


I had a very quick look at the source for the third one. There's a link to a github repository, and the code for the generator is there. Also, the licence seems to indicate that it is open source, so could be useful! And you're right, the radius I used was 6.
Unfortunatly I don't know javascript well enough to follow that donat studios one :( and the others aren't open source.

#53 per

  • Members
  • 6 posts

Posted 19 May 2013 - 11:32 PM

How is your GPS/persistence bit coming along ?
I'm EAGERLY awaiting this (I even had a hack at it myself..no joy :( ) as I have 64 block radius dome to build :D

#54 Keridos

  • Members
  • 75 posts

Posted 22 May 2013 - 07:29 AM

View Postuberadiant, on 14 May 2013 - 11:04 AM, said:

Hi guys, I've been following this for a little while but I have to point something out.

The circles that the turtle builds aren't very...umm, well, round. I understand that this code has come from another program but I think it should be mentioned (there is a pic below to illustrate this). I'm building a Star Trek museum world so as you can imagine, circles and ellipses have to be spot on for there to be any semblance of accuracy. Not sure if it's something that anyone feels is worth fixing, but thought I would point it out anyway. The various sphere generators available online all render circles almost perfectly, depending on the radius obviously. However, when I'm trying to create circles with radii of dozens or hundreds of metres, building them manually is both extremely tedious and horrifically time consuming.


Please don't take this is a criticism of anyone's work! The fact that you guys create these programs for others to use is great! I'm just being picky :P

Spoiler

Ok I thought it was only my brain tricking me, but I actually opened a bug report on github for this.

View Postper, on 19 May 2013 - 11:32 PM, said:

How is your GPS/persistence bit coming along ?
I'm EAGERLY awaiting this (I even had a hack at it myself..no joy :( ) as I have 64 block radius dome to build :D

I did not really work that much on that in the past few weeks, we still have to layout the basic concept of how we want to store the coordinates etc.

#55 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 23 May 2013 - 04:57 PM

Out of curiosity, Has anybody had any problems with 1.53? I can't get my turtles to move at all.

#56 psyestorm

  • Members
  • 15 posts

Posted 26 May 2013 - 08:31 AM

This has saved me a lot of time. Thanks for your hard work

#57 Steven McWayne

  • Members
  • 7 posts

Posted 27 May 2013 - 09:25 AM

One question,
is it possible to let the turtle place Platforms and roofs of rooms over his head instead placing under him?
At the moment it leaves 1 line/row of space between roofs and the natural rocks.

#58 Niseg

  • Members
  • 33 posts

Posted 29 May 2013 - 04:25 AM

View PostSteven McWayne, on 27 May 2013 - 09:25 AM, said:

One question,
is it possible to let the turtle place Platforms and roofs of rooms over his head instead placing under him?
At the moment it leaves 1 line/row of space between roofs and the natural rocks.

Most build programs build plates from above . My build program does the same (for plates). You might need a code modification to do this I'm not sure how flexible their code is.It's based on getting to a spot above and placing the block.

I've once made a piece of code called "universal floor/roof breaker". I just modified the code a little to create a "universal floor placer" . Be warned I have not debugged It seems to work.and make sure the turtle is in an enclosed room (preferably rectangular). place blocks from slot 1 and on and pre refuel it. The inventory handling is very simplistic . the turtle should be on the corner facing out (use turn command) and you need to tell it which of its sides has an empty space. it will continue until it hits a corner(that's why preferably rectangular)

#59 Cupcakecreator

  • New Members
  • 1 posts

Posted 30 May 2013 - 07:36 AM

Can someone help please, when i use the cylinder program and make a 75 x 5 cylinder underground after about 30 blocks it keeps giving this error:
shape:846: attempt to index ? (a nil value)

#60 CupricWolf

  • Members
  • 86 posts
  • LocationColorado, USA

Posted 03 June 2013 - 05:12 PM

View Postpsyestorm, on 26 May 2013 - 08:31 AM, said:

This has saved me a lot of time. Thanks for your hard work

You are welcome :)

View PostSteven McWayne, on 27 May 2013 - 09:25 AM, said:

One question,
is it possible to let the turtle place Platforms and roofs of rooms over his head instead placing under him?
At the moment it leaves 1 line/row of space between roofs and the natural rocks.

Because the code to build platforms is also used to build the roof of a cuboid we cannot change this to work from below, I'm sorry.

View PostCupcakecreator, on 30 May 2013 - 07:36 AM, said:

Can someone help please, when i use the cylinder program and make a 75 x 5 cylinder underground after about 30 blocks it keeps giving this error:
shape:846: attempt to index ? (a nil value)

Are you running the most up to date code? If so, can your turtles write to the file system? Can you also try EPwMT1ug





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users