MoI discussion forum
MoI discussion forum

Full Version: Cross Hatching experiment

Show messages:  1-7  8-27  28-47  48-62

From: OSTexo
23 Jul 2022   [#48]
Hello,

I've used MoI countless times for this style of drawing taking manual steps and complimentary applications to get there. I use the iso at points script in MoI to generate a line set, export the image with background, convert the raster background to a very limited color vector, boolean the iso lines with the vector background and use some brushes to apply the dot dashed style to the remaining lines.

The limitation in many cases comes is with the lack of lighting control in MoI. It's not really meant to have this feature so I find that positioning lighting on the model in another application, rendering it out and then compositing it into the background image of the MoI export works, even if it's sort of a long way around to get the line work flowing a bit better.

What I'm left with eventually is a pure vector line work technical illustration whose layers can be individually tweaked to change the drawing aesthetically, e.g. modifying line thickness, dot dash and line spacing. Most of the time spent with MoI export in my case is cleanup, little line fragment deletion, trimming intersections and overshoots in the 2D curves and extending curves along their tangents to their intersections. Currently it's just more efficient to perform those operations in other applications, but if those make it into MoI, it means one can stay in MoI and export a nearly complete illustration set with minor adjustments.

If MoI had features like an integrated distribution tool that works with the align tool and the ability to move and explode part assemblies, cutting planes, lighting control, surface and curve extension along tangents and little things like curved leaderlines and automated thick/thin line assignment it starts allowing for output of very high quality technical illustrations that don't need to be tweaked in multiple applications, an even bigger time saver. Suddenly highly polished technical illustration output doesn't take loads of time and money, MoI takes a larger role beyond design.

Having an interactive hatch tool would be next level stuff, similar in operation to the current iso tool to rapidly place down and move shading lines along the model surface but have the line termination depend on the brightness value. That sort of tool also might open up possibilities for more defined thick thin line assignment. Of course that comes back to lighting intensity and position control within MoI but your illustration output that took minutes would only look like it took days.
From: Michael Gibson
23 Jul 2022   [#49] In reply to [#48]
Hi OSTexo, well there are a couple of things there that are relatively low hanging fruit. LIke improving Extend is something I can likely get to pretty soon.

Can you describe a little about what you would need for lighting control?

- Michael
From: Mindset (IGNITER)
24 Jul 2022   [#50]
Hi Michael ,

Could we designate specific preset hatching options to various faces selectively?
Might they generate into different styles so that they remain selectable as layers in Affinity Designer?

This could be huge !!
Thanks ,
MindSet
From: Michael Gibson
24 Jul 2022   [#51] In reply to [#50]
Hi MindSet,

re:
> Could we designate specific preset hatching options to various faces selectively?

Probably not for now at least. Maybe in the future it could be a property of styles.


> Might they generate into different styles so that they remain selectable as layers in Affinity Designer?

Yes I think there will be a new entry in the Line style options dialog where you can currently set up how Visible lines, Outlines, Silhouettes, Hidden lines, and Annotations are organized in the output.

- Michael
From: pressure (PEER)
27 Jul 2022   [#52] In reply to [#48]
OSTexo,

Thanks for pointing out the IsoAtPoints script and for asking Michael to make it years ago. I gave it a try and am hoping you can give me some pointers.

I found that this script accepts 1 face only, so I'm running the script 8 times to go around a filleted rectangle:



Is that what you'd do in this case, have you modified the script to accept multiple faces, or can you recommend some other workflow?

I found that the singularity in UV occurs at different vertices on different corners of a filleted rectangle and so I end up with isocurves that fan out at some corners but are parallel at others. Do you carefully construct solids so that the UV coordinates will be right for line shading, or how do you handle UV parameterization that doesn't jive with how you'd like shade lines to run?



What do you use for fragment deletion? I'm using an Illustrator script by John Wundes called SelectPathsBySize

Image Attachments:
IsoAtPoints_1face.png  IsoAtPoints_UV.png 


From: pressure (PEER)
27 Jul 2022   [#53] In reply to [#47]
Michael,

Thanks for explaining more about how your method works.

re:
> the whole general idea of "evenly spaced lines of curvature" is rather ill defined.

You're right. I was fixated on solids of revolution and was thinking about lines being equidistant in polar coordinates, but clearly that's not generalizable. I'll put some more thought into what I mean by "evenly spaced"".

At the very least I now agree that hatch lines must be selectively shortened where they radiate from an umbilic to avoid drawing undue attention to a point that's not important. I tried this manually and found that I needed to thin out hatch lines significantly, though still not near evenly spaced in image space:





Instead of even spacing in image space, what about a minimum distance between shade lines in image space? Maybe that's what you're doing already.

re:
> Something like a torus could also be prone to them going on and on

You've likely already thought of this, but attached is an academic paper where the authors terminate integration when the ends of a growing line of curvature are within a small distance from each other and then force the line to close by distributing the integration error over all of the integration points. This might run into trouble on a twisted surface, so the user would need some control over the small distance. See Fig. 4 and the text immediately below on page 4 of the attached PDF. Here's an ellipsoid that they made from paper strips:



and here's a video showing how they wove car body panels out of paper strips that follow curvature lines:

Image Attachments:
distracting_umbilics.jpg  thinned_umbilics.jpg 


From: OSTexo
27 Jul 2022   [#54]
Hello Michael,

Position, size, shape, intensity and the ability to save/edit/delete lighting setup. I realize MoI isn't really intended for this sort of thing and other render tools can get close enough to cobble things together even though it's sort of clunky.

In thinking about it a bit more if you were you make the process interactive you could use sliders and/or numerical input to define a starting iso density, it looks like you have the ability to have the isolines retain continuity across surfaces, that's a good thing. Being able to group, join and merge lines that are connected end to end would be really useful as well, this enables the designer to determine the flow of the shading lines to give a different look to the drawing.

Being able to automate these sort of tasks would really speed up the process and if made somewhat interactive one could quickly iterate and clean up designs.
From: OSTexo
28 Jul 2022   [#55]
Hello,

I've cobbled together a workflow for illustration that works pretty well for me even though it does require repetition.

When a model is completed I use Array > Curve to lay down a set of points along edges on one side of the model. If the model is symmetrical on an axis I'll use a midpoint to start. I'll then run the IsoAtPoints script surface by surface in a single general direction, having the shading lines moving one way just gives the eyes a direction to follow although it's really just an aesthetic choice.

In order to keep the shading lines consistent across multiple surfaces I use the MarkCurveStart and MarkCurveEnd script and walk my way across surface by surface. Michael Gibson provided the way to make one change to the start script which then allows end to end matching of shading lines across surfaces. That provides a set of shading curves which then can be exported.

Depending on the exported curve set I determine whether to use Illustrator plugins from Astute, limited palette image tracing and segment deletion in Corel and then curve cleanup no matter what application downstream is used.

I still haven't figured out how to round trip the AI files back into MoI to use the curve editing tools there, the dimensions always seem to be a bit off when edited. If the technical illustration focused features make it into v5 that just means a more complete deliverable being output right from MoI.
From: pressure (PEER)
29 Jul 2022   [#56] In reply to [#55]
OSTexo,

Thank you for talking more about your process. I don't understand what you're using MarkCurveStart for. I would have thought that 2 abutting faces always share an edge and so the intersections of the shade lines and the edge could be used to transfer line spacing between faces. I guess I haven't run into the problem that MarkCurveStart solves, but I'm glad you brought it up so that I'll know about it when I need it.
From: pressure (PEER)
2 Aug 2022   [#57] In reply to [#47]
Michael,

I've been doing some manual experiments and have changed my mind about hatch spacing. You are right: for a surface having a uniform tone the hatch pitch should be uniform in image space. The thing that had me thinking otherwise was hatching with min curvature lines on a cylinder where uniform pitch in object space gives an illusion of curvature while uniform pitch in image space looks like a flat cutout:



But, I played around with some other shapes and am now pretty sure that all that's happening here is that uniform pitch in object space just happens to emulate the shading that results from a headlight in this one case. In other words, uniform pitch in object space is bad for other shapes.

Here's the most challenging sort of shape / viewpoint that I've tried to get uniform tone on:



It's bad because the shape is smooth and so I've found that breaking the hatch lines acts like a rough texture, because there are no natural locations at which to decimate the hatch lines in a discrete way, and aliasing + moire wreak havoc at the front and back.

Would you run this ring through your system and see how it comes out? Model and ViewManager file are attached. Please omit raster shading.

Sorry for being glib about accuracy. I've come to realize that integrating a direction field is a hard problem. I'm impressed by how well the examples have turned out if this integration is taking place in image space. I do believe that integrating in object space could have major advantages because the direction field would remain continuous at silhouettes, because face symmetries could be used as a hard cue for growing curvature lines, and for artistic flexibility. But, I don't have anything really useful to say on this at the moment so will keep working on the idea.

Regarding cones, I don't think there's a perfect solution for min curvature lines converging to the vertex. Here are the solutions that I know of, with max curvature lines being a clear winner:

Attachments:
ring_1049_.views.json
ring_1049_080222.3dm

Image Attachments:
cone_matrix.png  cylinder_hatch.png  ring.png 


From: Michael Gibson
4 Aug 2022   [#58] In reply to [#57]
Hi Peer,

re:
> But, I played around with some other shapes and am now pretty sure that all that's happening here
> is that uniform pitch in object space just happens to emulate the shading that results from a headlight
> in this one case.

Yes that makes sense. I guess that's a general problem that any locations with lines getting close together can get interpreted as a low illumination area from shading.

And then if you are actually doing shading aware spacing that might be even worse because then you'll have some areas with higher density from shading and some with higher density that is not from shading.

re:
> Would you run this ring through your system and see how it comes out?

Here are a couple of results, first with "tightly packed" lines where it tries to insert a new one as close as it can to existing ones, and the last 2 with sparser filling:









- Michael

Image Attachments:
peer_ring1.png  peer_ring2.png  peer_ring3.png  peer_ring4.png 


From: OSTexo
4 Aug 2022   [#59]
Hello,

I us the curve start and end marking so I can keep continuity of the shading curves across surfaces. If a pronounced separation between surfaces is desired then I wouldn't use the mark start/end.

In the image example I started at one end equally spacing points around the end using array curve, then iso at points, then for every subsequent surface I marked the generated curves with mark at start/end depending on the curve direction and repeated the iso at points command.

That left me with a whole set of lines which I then exported with a raster background to .ai using the default lighting in MoI. I then trimmed the excess transparent raster data from the background image so the bounding box of the vector curves matched the background image.

At that point there are multiple ways to post process the file to get the look and application you use, but they all usually involve adjusting the levels of the background image, converting the background to a limited color vector image and then using that background vector to perform automatic or manual operations to the set of vector shading curves.

I may be mistaken but the operations developed by Michael are getting you much further ahead in MoI itself. Getting contiguous shading curves out of MoI cleanly trimmed by using lighting in MoI just leaves having to specify curve width and/or vector brush stroke type. That leaves you with limitless aesthetic options when you have a clean set of vector curves. Being able to add/tune things like dash/dot and stroke style is something done easily enough outside of MoI in nearly every vector illustration program, this hatching feature can save a bunch of work in the middle of the process.

Image Attachments:
pipe.jpg 


From: pressure (PEER)
6 Aug 2022   [#60]
Michael,

Thank you for trying a couple of methods on the ring. I prefer the sparse version because it gives fewer radial fragments on the top of the ring. I'm surprised by how even the tone is on the top of the ring in ring2 and ring4 while also looking smooth. I'll try some more experiments to see if I could live with the deviations between the line trajectories and the UV direction field.

OSTexo,

Nice pipe! Thank you for explaining. I now understand how you're using start and end markings. That's a great trick that I'll definitely use.
From: pressure (PEER)
11 Sep 2022   [#61]
In anticipation of the release of cross hatching here's a script that allows the hatch direction to be changed on planar faces of solids.


Attachments:
UVchanger-plane.js

Image Attachments:
UVchanger-plane.gif 


From: Frenchy Pilou (PILOU)
11 Sep 2022   [#62]
UVchanger-plane
Works like a charm!


Show messages:  1-7  8-27  28-47  48-62