kevancress / MeasureIt_ARCH

MeasureIt_ARCH is an addon for Blender, that adds tools to create design documentation and technical drawings that can be previewed within Blender's 3D viewport, and exported as images, vector graphics or .dxf files. Read the Doc's here:
https://kevancress.github.io/MeasureIt_ARCH/
Other
255 stars 36 forks source link

Hatch Pattern Improvements: Add Offset, Less Arbitrary Pattern Bounds, Draw Hatch Pattern at Correct Scale #234

Open baldyman01 opened 1 year ago

baldyman01 commented 1 year ago

Hatching seems to work with patterns of 1m in size, which I guess is 1 unit, the origin needs to be in the minY and minX position of the pattern as only Y+ and X+ geometry data is used. Which is not a problem but should be mentioned in your doc update.

The default pattern size is somewhat odd as to make a 1m hatch fit on a 1m face I have to use a size of 250. I would have thought that the default should be 1 = 1 unit pattern on a 1 unit face.

As a feature suggestion it would also be helpful for non-continuous patterns like insulation hatching to be able to offset the hatch pattern in X and Y

kevancress commented 1 year ago

Hey @baldyman01 Think I've got the scale part of this sorted out in 9fe76a8a8d9eee729fa82a185689a62d3721a243. Give the latest development version a try and let me know how it works!

Still working on an offset option, and some way to make the svg pattern based on the hatch collections bounding box instead of the 1m x 1m positive X & Y direction. ( which should be a bit more intuitive when creating hatches)

baldyman01 commented 1 year ago

Hi Kev,

It took me longer than it should have to figure out that the Pattern size is in pixels.....

So to make sure I understand the logic before telling you it's wrong again -

An A4 view @ 150ppi is 1753x1240px - a Pattern Size of 1753 fits the view exactly width wise. At 1:10 I get - _View 1_0001

The hatch does not currently scale with the drawing contents when View Settings -> Scale is changed. So 1:20 view produces - _View 1_0001

Ideally you'd always want the pattern to exactly fill the width of the face it's applied to, but I can't see how you'd do that as it's completely arbitrary. In reality you'd normally be working with a few categories of wall each with a width and/or hatch.

So if you could take the pattern size from the hatch bounding box size it becomes related to the size of the mesh, not the size of the output/camera. All we'd have to do it set up one hatch per wall type, which is not exactly onerous.

I think I'm with you. Scaling does my head in.

kevancress commented 1 year ago

Hey @baldyman01

Yeah I think that's correct on the old behavior, but the change I pushed yesterday should take some of the calculation out of figuring that out!

The latest version should respect the true dimensions that the hatch was drawn at (accounting for resolution and scale automatically) So a grid hatch drawn with .25m spacing and a pattern size of 1 should render true-to-scale at .25m now, in any view, with any resolution and scale settings.

having the pattern scale to match the face width / bounding box width would be super handy for insulation style hatches, but probably not something you'd want in all cases I'd imagine? Maybe an option in the hatch settings to "scale pattern size by face width" or something like that could work? If I can figure out how to do that haha.

Let me know if the new scaling works for you though. I think having it based on the scale it was drawn at, rather than in pixels, is probably easier to manage?

baldyman01 commented 1 year ago

Hi, Kev, I'd managed to not update it properly. Yep the scaling looks right to me now. It's much easier to manage now :)