Hatch / Bhatch

I'm trying to cover an area in an architectural map with a pattern that consist of two or more colors that are repeated, like black and white in a Crosswalk.

The method I use is as follows: 1. Build a a close polyline.  2. using a HATCH command with patern ANSI31 or similar to fill the enclosed area. 3. Explode the hatch Pattern.

4. Fill the shapes alternatley with color of choice.

It works fine, as long as the polyline consist of line segments only. If there are arcs in the polyline, the hatch pattern do not reach the boundary, and a gap remains.This gap prevents making the desired hatch.

Is there a any solution ?

Raam.

Comments

  • It works ok for me, though I noticed I can't finish a pline with lines and arcs by typing C to close while drawing an arc - must finish that way with a line.

    I do get a similar problem to yours using Associative hatches - they are ok until I close and reopen a file, then the hatches which fill  multiple boundaries sometimes have areas missing.

    There is a similar pain to yours with plines - trimming and extending use imaginary extensions of their lines and arcs rather than their actual boundary.

  • Choosing a different value for HPGAPTOL may help.

  • There may be a faster method to accomplish this:

    1.) create a region from your closed boundary, and transfer this (for convenience) to another layer

    2.) create a rectangular region that represents one stripe of your pattern (well overlapping the width of your  boundary)

    3.) create an array of the stripes that covers your boundary

    4.) subtract the striper regions from the boundary region

    5.) apply a solid hatch to the result (select entity)

    6.) if needed, apply a solid hatch to the inital polyline boundary and move it behind the stripes as  background color

    This should also work with spline boundaries, but at the moment it fails (I'll post a SR for this). I also did not test whether this solution scales well...

  • Hi Raam,

    Just to return to the original query, to create a two tone Hatch. As a rule I would generally avoid exploding hatch patterns, apart from the potential ballooning in drawing file size, it can make a drawing a nightmare to deal with, which is inferred by the discussion following your initial query. Instead I would suggest you try overlaying Two hatch patterns to achieve the result you require. I got something close to your description by doing the following:

    1. Generate your closed area as before, doesn't necessarily have to be a closed polyline unless you need this for other purposes.
    2. Create a Two layers. One layer is for the Hatch background, and the other for the hatch foreground. Set these layers to the two colours you require.
    3. On the Hatch Background layer, hatch the closed area with a SOLID fill.
    4. On the Hatch Foreground layer, hatch the closed area with a banded hatch. I used the STEEL pattern for this, as it has thick band section similar to your description. You may need to temporarily turn the background layer off so you can see what you are doing.
    5. Use DRAWORDER if necessary to get the foreground hatch to the front.

    You should end up with a two tone pattern in your closed area.

    If you CUTCLIP the two hatch patterns, then use PASTEBLOCK you can group the two hatch patterns together as a block, which may make them easier to manage.

    If you inspect the STEEL hatch pattern you will see that the thick band is actually made up of a number of thin lines. With the appropriate pen weight this will print as a solid colour. In fact using a fine scale hatch pattern is how people used to do solid fills.

    You can create your own hatch patterns by editing the Default.pat / Iso.pat definition file with a text editor (make a back up before you do!!). Hatch patterns however use a rather arcane syntax. I would recommend that you instead have a search around the net to see if someone else hasn't already created a pattern close to what you want, or play around with some of the other default patterns to see if you can come up with something acceptable.

     

    Regards,

    Jason Bourhill

    CAD Concepts

  • Hi Raam,

    Another option you could consider, particularly if you want to create multi-tone, or other pattern fills would be to use an IMAGE instead of a hatch pattern:

    1. First create the pattern you want using a paint program. Save as a JPG/PNG/TIF whatever you prefer.
    2. Attach the IMAGE to your drawing and ALIGN to the space you want to fill.
    3. Once your happy with the look of it use IMAGECLIP, and clip the image using the Polygon option tracing around your enclosed area.

    Unfortunately Bricscad doesn't currently allow you to select a polyline to create your clip. If this was the case you could create a polyline boundary (use BPOLY) of the space you want to fill and use that with IMAGECLIP. Hopefully this will feature will be added in the near future. In the meantime I would only use this method for simple shapes.

    Regards,

    Jason Bourhill

    CAD Concepts

  • Hi Roy.

    'HPGAPTOL' is set to zero (0.00), so the answer is not there. I think that the answer lies with some code, because all the other suggestions, although they are good, include a lot of work.   I prepered a small example of straight segment, I would like you to play with. The problem is I don't know how to upload it to the forum.

    Any suggestion ?

     

  • @ Raam:
    Have you tried making HPGAPTOL bigger than zero?
    Have you tried extending the lines that have gaps so that they touch the polyline? You can use a fence to efficiently select them.

    You could also try this:
    1. For the bands, create an array of lines crossing your closed polyline.
    2. Trim the lines using the closed polyline as the cutting edge. Use a fence to select the lines in the array.
    3. Hatch the bands in alternating colors.

    You cannot upload files to the forum. There are however several file hosting sites out there.

This discussion has been closed.