Well, I work mostly in Photoshop, and it has a few things that make these lines and shapes possible. Firstly - the lasso tool, polygonal lasso can be used to draw the outline of the shape, and then painting is enabled only in that area, so you get the sharp edge. Just like masking in traditional painting, or using a ruler.
Secondly - the path tool in shape mode, and the line tool are some things I use. Lines in raster mode, paths in shape mode so I can edit them. I have a lot of experience with those.
I really do a lot of geometric stuff for work, so I developed the feel for it. Tools like the lasso only make it easier.
Also, I work in high resolution, and you can always use the sharpen tool for areas you need sharpened, but save that for the post-production if you're new to everything.
You can make straight lines with the brush tool by holding shift, but that only gets you horizontal and vertical straight lines. Anyways, everything requires practice, and practice makes better. Have a nice day.
Wow here's a true dimension illusion world going on! what a beautiful piece of work. A bit of dark and light going on. There's so many strokes to be considered, so many colours, so much composition seems to be proposed too. Genius work! It's the kind of image you could stare at for awhile and get a little lost in it. You can nearly see hallways in it too, not just building, I see firearm, I see robots, I see wet streets, I see so many stories in one.