I am working on cylinders in WorldEditArt, and due to my stubborn and impatient nature, I am trying to let cylinders be oblique. So, I am defining a cylinder with these parameters: Code: T(x2, y2, z2) ||| v ^ / \ < \ \ \ \ \ \ > \ / <= B(x1, y1, z1) v <= distance from B = r This is a the side view of an example of the cylinder, where B is the base point, T is the top point and r is the radius of the cylinder. Now say, if we are having a right cuboid (a cuboid that is perpendicular/parallel to the X, Y and Z axes) to just inscribe the cylinder, like this: Code: ________ | ^ | | / \ | |< \ | | \ \ | | \ \ | | \ >| | \ / | | v | |--------| How can I find out the dimensions (minimum and maximum X, Y and Z coordinates) of the cuboid? To set all blocks in the cylinder, I am trying to iterate through the integer points inside this cuboid, check distance of the point from the central vector BT (which I already found out how from Wolfram Mathworld), and if true, update the block. Or is there another way to do this without iterating through blocks in the cuboid?
Just to make sure, that I (and others) fully understand your concept, are you also trying to achieve a circular shape from a top view? As smaller cylinders maybe not be able to achieve that circular shape. Btw the shape you provide seems like your cylinders are more of tilted, than oblique.
By oblique cylinder, I meant tilted cylinder. It is still a cyliner, but it is placed at a different angle.
I'm asking how to do that... Anyway, https://github.com/PEMapModder/Worl...deditart/libworldedit/space/CylinderSpace.php
oblique means tilted. I have wrote the code to check whether a point is in the cylinder, but I need code for vector-plane angle to calculate the boundaries.
Let me simply the question: How to get a line's angle with a plane in a 3D system, where the line is defined by two points of coordinates?
I see what you mean. Like this? Code: / / / / / / / / / ) θ ≤_________ (Calculate this point by (X2, Y1, Z2) (Then use cosine to calculate θ)
When you project a tilted cylinder on the ground (y=0), the shadow will be one tilted rectangle + two ellipses. The size of these ellipses is r * (r cosθ), θ is the angle between (0,1,0) and (X2-X1,Y2-Y1,Z2-Z1). sorry poor English
Thanks. So what do you think about this code? https://github.com/PEMapModder/Worl...deditart/libworldedit/space/CylinderSpace.php
Not tested. I used r*cos(length/projection length) to calculate the distance between lower center and lowermost point, so it should be correct.