Inkscape Community

Help Using Inkscape => Inkscape Beginners' Questions => Topic started by: MongrelShark on August 18, 2018, 06:56:26 PM

Title: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 18, 2018, 06:56:26 PM
Hi guys.

I'm a newish inkscape user with no clue about vector graphics. Or drawing, or art. I'm an engineer  :) This is my first post here :D "Hi"
I am here because I have made some drawings with freecad (Tech Draw workbench).

I need to hatch various areas of these drawings. But freecad is having issues recognizing faces and surfaces properly. I have spoken to the appropriate freecad Dev. A fix is a while away.

Its possibly easiest to just export .svg from freecad and add hatching in inkscape. Except I am not getting far, and its taking a long time.

I have read a few tutorials on hatching. Have made some custom patterns. Cant use them though because they wont line up right if I have the same pattern in multiple "areas". And they are just fiddly and unstable. I feel I am missing something here. Would prefer to constrain lines via propertys, rather than dragging with mouse. ie set angle to 45 degress. rather than dragging mouse to some close but random value I wont be able to replicate later. As with freecad. Having isues defining the areas to fill.

Have tried an eggbot hatching extension. Got it installed. Its on my extension menu. But cant get it to actually do anything


Then found this tutorial https://inkscape.org/en/~henkjan_nl/%E2%98%85patterns-for-mechanical-drawings-in-inkscape
which is closer to what I want. But its way over my head. I have no idea with python or anything else in that tutorial. (Aside from a good dose of PTSD from the time I had to convert (with gedit :xf2:) the company drawing template to scale for freecad template. Pleas no more .svg coding!!!)

I tried copy object properties with some success. From the examples. But the scale is all out. Came out shaded. Then inkscape crashed, so no example image.

What I really want is to make some patterns and save them in inkscape for future use. As described in the tutorial. But scaled correctly for freecad created documents. (1mm=1px I think)


One extra concern is how patterns in multiple areas line up. Consider the cross section drawing attached. The two outer tubes need hatching on cut faces to line up. Not sure how to describe clearly in digital terms. But to do it by hand I would put my ruler across both sections when drawing hatching lines. and fill in any areas under the ruler before doing the next hatch line So each line appears in each field as a continuous line. I'm afraid I'm not making a lot of sense here, but anyone famillar with mechanical drawings should get the idea. I hope

The other problem I get is similar to freecad. Having issues defining the area to fill.

I have attached an example file and some images to help explain.

my inkscape version is 0.91 and I'm on Ubuntu 16.04. (I'm pretty clueless with Ubuntu/Linux too. No CLI instructions if at all possible. I like to click stuff with a mouse)

 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Lazur on August 19, 2018, 05:25:03 AM
Hi.

I feel your pain, had similar problems too many times.
Before trying to achieve acceptable results within inkscape, I'd check if any of those pattern fills are compatible with the cad software.
Pattern fills in inkscape are a matter of rendering -the underlying vectors embedded in a base tile are rendered repeatedly. Have serious doubts of them being converted to full vector content covering an area.
As far as I know inkscape saves them still as pattern fills in pdf-s so there is a chance they won't be converted when saving as dxf.

On the other hand the mentioned geggbot extension or some gcodetools would produce a "real" hatching of lines. Have to dig deeper I'm not familiar using those.

Still, remember Tavmjong wrote something about vector hatching is a concept of future svg specs.
Well not in the near future (http://libregraphicsworld.org/blog/entry/gradient-meshes-and-hatching-to-be-removed-from-svg-2-0) though.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 19, 2018, 06:57:29 PM
The patterns would be usable to freecad. Tech Draw. The workbench that produces drawing files is based strongly on .svg/inkscape code. There are a few basic patterns already installed and I can put more in once I work out how (probably just put the .svg files in the right folder). The Developer of Tech draw has been very helpful, and I try my best to provide decent beta feedback. As the workbench is very new. Thats not the problem though.

My issue is that its (freecad) not making the boarder around a shape quite right. Especially when I have proper threads with radius on the pointy bits. Also problems where a curve looks straight from the drawn perspective. Like the holes in ends of rods in my example drawing.

So when I go to fill. Both inkscape and freecad are producing strange results. I might get areas outside the selected area get a pattern. Like the image on previous post where the text also got patterned (that one was probably me not selecting the right stuff to pattern, but its happened when I did it correctly too). Or its not filling the shape at all. Or its filling parts of the shape and leaving blank bits.

After playing around more while waiting for the Moderators to ok this post I was able to fine tune my questions a bit. And come up with a better example document. Attached eg for hatching2. ( Pun warning: if the eg hatches well, will I get chickens? Or maybe a Linux Penguin? :-D)

I updated my 3d model to include radius on the thread tips. As a proper thread should have. This breaks the .svg output pretty badly and in the same way as the "real" file I can't show. I have hatched a few areas I wouldn't normally hatch. Just because this shows my problem quite well. Also because the main area I want to hatch (The large face created by cross section) is just not working at all. I think this is because its not a "Closed Shape" It looks like one. But something in the document is not actually connecting the lines. They are just sitting there in the right place.
 [ You are not allowed to view attachments ]   [ You are not allowed to view attachments ]

So Looking at attached documents and screenshots. I was able to hatch the top recess and cross hole in a useful way. I just selected the bit I wanted to fill and shift+ctrl+V pasted my hatch in. Took a couple of tries to realize I want to do the small shapes first, then the background shape. To avoid hatching over the circle with the background. But when I tried to do the same on the lower recess and hole it all went badly.
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

First I couldn't fill the hole. There is a triangle thats not hatched for some unknown reason.
Then when I hatched the recess (rectangle area) it hatched outside the selected area and added some new boarders and hatched over my circle. Taking a closer look at the circle showed I had a full circle made of 3 sections, and another bunch of left over bits.
 [ You are not allowed to view attachments ]  

My messed up file is attached as eg for hatching 2.1

What I am hoping to do in inkscape is define the shape outlines manually. So I can fill properly. Also need to find out what caused blank areas and stop that too. Hopefully with some drag the box style selecting. If I have to click each bit manually I may as well just learn to draw the drawing from scratch... As its already time consuming to generate the drawing in freecad and I know every dimension by heart after working on one part for many months.


I also hope to find some hatch property's so I can change the angle, line thickness and spacing. Using numbers, not the node tool. Also interested in getting one node tool for multiple fill areas if thats possible. But strongly prefer to edit hatch patterns with numbers. ie what if I want to change line spacing, but not line thickness? Or I want to change line thickness and not spacing? Or I want to change 45deg to 44deg. Or just move the pattern center, so its not doing funny intersects with its boarder. Without changing any dimensions... Node tool seems to change everything all at once and is really hard to control. Especially with a regular mouse or touchpad.

Finally I think I need to understand inkscape basics a bit better. Having issues with group/ungroup. Not sure I am using it properly (only found it due to random clicking stuff and see what happens). As well as possibly related issues with some "Invisible Shapes" that get in my way when trying to select stuff. I think I might need to use layers or something? Or just delete a bunch of junk artifacts in the document.
Also not sure when I should be using node pointer :node: and when I should be using the regular pointer :sel:?
Its also really annoying that I keep moving parts of the drawing!! Can I lock all my locations down before editing? or use a different pointer? I'm wearing out my ctrl+z putting stuff back where it was because I don't know how to click on the right object.

If someone could show me step by step how to hatch this document I think a lot of my errors would become obvious. Don't leave anything out. I know nothing except what I have learned from randomly clicking stuff.
If there is already a detailed tutorial, please point me to it. i have googled for days and days over the last 9 months.
Also open to suggestions on other open source software for drawing plans and mechanical designs etc. Like libreCad for example (Thats got a huge learning curve too!!! I'm hoping for something more like ms paint, with dimensions that can be locked in)

Oh and one last thing. I don't need to export dxf or anything fancy. .pdf is the end goal.

Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 19, 2018, 08:16:46 PM
Holy crap, that's a long message!  I'll have to take it bit by bit, partly because I don't completely understand what you're trying to do, which is partly because I don't understand the mechanical drawing language.

However, I can probably troubleshoot some of the hatching problems.  Do I understand correctly that you're using a pattern fill for the hatches - a custom pattern?

Aah, I was about to ask for an SVG file, but I finally see what I need, already attached.  Let me examine the eg for hatchin2.1.svg file, and maybe I can figure out that missing traingular area.

And I think one of your questions is about....closing the shapes properly, so that you can fill them.  You may be already on the right track for that, I'm not sure.  I'll have a better idea when I look at the SVG file, in a minute.  Sometimes you can fill a shape that looks closed but technically is not a closed path.  But usually it's good practice to make sure they are closed.

A closed path means that all the nodes are joined together.  You can do that with the Node tool, if you didn't already discover it.  Select the 2 nodes which are open, and click "Join selected nodes" button on the Node tool control bar. 

The control bar is the first row of buttons and switches and dropdown menus and etc, immediately above the horizontal ruler.  (The one above that is the command bar, just fyi.)  The control bar changes for every tool, and contains various options for configuring whatever tool is enabled.  Or if you prefer keyboard shortcuts, usually you can see the shortcut either in the menu item or tooltip.  But if you can't find it on the canvas, try Help menu > Key and Mouse Ref. 

(I would suggest to avoid the Eraser tool.  If you need to remove something, we can tell you how.)

I also hope to find some hatch property's so I can change the angle, line thickness and spacing. Using numbers, not the node tool. Also interested in getting one node tool for multiple fill areas if thats possible. But strongly prefer to edit hatch patterns with numbers. ie what if I want to change line spacing, but not line thickness? Or I want to change line thickness and not spacing? Or I want to change 45deg to 44deg. Or just move the pattern center, so its not doing funny intersects with its boarder. Without changing any dimensions... Node tool seems to change everything all at once and is really hard to control. Especially with a regular mouse or touchpad.

That probably won't be possible using pattern fills.  But there might be another hatch tool (somewhere) which can do that.  I would think there should be a forum or at least tutorials for a lot of the eggbot toys.  I think Moini may know a little bit about it (more than me, anyway).  She should be around before too long.

It sounds like you might have already figured out how to edit patterns using the Node tool.  But I'm not positive about that.  Have you found the tiny x, the tiny square and the tiny circle handles, which can manipulate the patterns?

I can give you some tips about selection and not moving things accidentally.  But I'm going to wait until after I look at your SVG file.  That might tell me more about how you've been working.

I don't know if you've found the Hatches LPE yet?  I'm not sure if it can do the kind of hatching you want.  On the surface it looks like it does the kind of hatching that can resemble what you might do when sketching with a pencil - back and forth and back and forth, with a sharp curve or point between each long line.  I don't know if it can be configured to do the 'one line at a time' type of hatching which you're working on.  But it is highly configurable.  If I have time, I'll study it (which essentially means trial and error with all the buttons and switches).

Ok, I'll post more after I've had a look at the SVG file.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 19, 2018, 08:39:58 PM
Ok, the "missing triangle" happened because the circle is not a closed shape.  For some reason, which I haven't figured out yet, it's made of 3 pieces.  Ungroup that object, and you can pull apart the 3 pieces.  You can see what I mean when I say that sometimes you can fill a path that's not closed.  So you filled those 3 pieces of the circle, but because the circle is not closed (either closed path or circle shape) it didn't fill properly.

One thing I can't figure out is what's under the 3 part circle.  It's a series of 2 node paths in the shape of a circle, except not a solid circle.  Are you aware of how that happened?  In fact, throughout this file are lots and lots of 2 node paths which are not connected together, although they are lying on top of other paths.  Most of them are a Group of 1, which gives me a clue that you might have opened a file which was started in another program, in Inkscape.  That might or might not have resulted in a format conversion.  Was part of this drawing started in another program, and as a different format?

Oh right -- now I've re-read part of your messages.  So these were started in freecad, right?  Yikes!  No wonder you're having trouble making closed paths!  But some of the eg for hatching2.1.svg file has been drawn with Inkscape, right?

Have you already attached the original file for this?  I'd like to look at that, so that I can tell you how to join all those segments into closed paths.  Is that eg for hatching2.svg?

Geez, no wonder you're confused, haha.

I'm almost positive that eg for hatching2.svg is the file that came from freecad.  But before I launch into instructions for joining those paths, let me ask this.  Will you be using any of these paths in any kind of digital cutter, CNC, gcode, laser cutter, anything like that?
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 19, 2018, 09:02:36 PM
Sorry about long post. Trying to explain stuff well when I don't know the technical language is tricky...



However, I can probably troubleshoot some of the hatching problems.  Do I understand correctly that you're using a pattern fill for the hatches - a custom pattern?
I'm not sure of the correct terms. I used the Hatch Patterns.svg that came with this tutorial https://inkscape.org/en/~henkjan_nl/%E2%98%85patterns-for-mechanical-drawings-in-inkscape as described in the tutorial. click on pattern in hathes document, ctrl+C to copy. Then shift+ctrl+v to paste the pattern in to working document. I have tried making custom patterns too, but can't get the lines consistently and repeatably well spaced and angled using node tool. Long term goal is to use the python script from tutorial to make a set of patterns I can save in inkscape, and maybe freecad as well. But I'm a linux dummy sometimes and don't know how to use the script.. (probably right click and run, haven't had time to play around yet)


And I think one of your questions is about....closing the shapes properly, so that you can fill them.  You may be already on the right track for that, I'm not sure.  I'll have a better idea when I look at the SVG file, in a minute.  Sometimes you can fill a shape that looks closed but technically is not a closed path.  But usually it's good practice to make sure they are closed.

I'd like to learn to make closed shapes. As well as hatching. If I can get my basic incscape skills up a bit. I can import .svg into freecad and make into 3d object. Sometimes this might be a better way. For stuff like text, logos etc on parts... Shapes need to be closed for this to work. Freecad does not like open shapes, stuff is bound to go wrong... This is the main problem I need to solve. Hatching with numerical properties is a bonus.

A closed path means that all the nodes are joined together.  You can do that with the Node tool, if you didn't already discover it.  Select the 2 nodes which are open, and click "Join selected nodes" button on the Node tool control bar. 

Freecad has similar system in its sketcher. Not constraining end points to make a shape will give you a bad day when you try to make the sketch 3d. lol.

So with my drawing. some parts like the thread have a lot of nodes. Can I box select a bunch and close them? Or does it have to be 2 at a time? Played around with this but was unsure how to tell if its working...
Might be quicker to draw over the existing drawing on a new layer or something? If I can't multi select a bunch of nodes at once.


I can usually find the node tool for pattern adjustment. with the X square and circle. If I remember to use the node pointer  :-D Thats a big trap for new players. I'll get sick of getting caught soon and remember...

Also starting to consider editing .svg file in text editor. i think angles and line thickness are in there, and I might have worked out how to find the right bit quickly. I see this as a last resort. I hate editing code because i tend to break it. Many times before i get it right. Like I said above. Hatching well is secondary. First I just need to get hatching in the right places.

if i want to delete stuff. I usually select it and press del on my keyboard. Often followed by ctrl+z lol. I've also moved it to a new layer and made invisible if I think I might want it later. (I know nothing so will probably want it later)

One thing I can't figure out is what's under the 3 part circle.  It's a series of 2 node paths in the shape of a circle, except not a solid circle.  Are you aware of how that happened?  In fact, throughout this file are lots and lots of 2 node paths which are not connected together, although they are lying on top of other paths.  Most of them are a Group of 1, which gives me a clue that you might have opened a file which was started in another program, in Inkscape.  That might or might not have resulted in a format conversion.  Was part of this drawing started in another program, and as a different format?

Yep. I know mostly whats happened there. Firstly. I saw the 3 parts of circle, and grouped them. I know now I should have used node tool to join the ends. Thats what I was trying to do with group.

Also the entire document was one group when I opened it. I had to right click and ungroup to do anything.

As to the other partial circle pieces. I'd say thats freecad trying to draw the background. ie its a drawing of a hole. where the view angle is looking straight down the hole. You can see all of the top/front side of the hole, and probably bits of the back/bottom end of hole. So freecad drew it that way.
 Ive added 2 screengabs to try and explain better.
One is from the view angle the drawing is of. The other is adjusted so you can see the hole wall and other end. The extra circle bits in .svg output are from freecad trying to draw the wall or other end of hole...
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]


Yes eg for hatching2 is the raw output from freecad with no changes made . Also check eg for hatching.svg in my first post. This does not have radius on threads and made a solid shape. I think. Might see something useful in comparison... This may be useful to the drawing workbench developer...
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 19, 2018, 09:12:42 PM
Yes, this is a more complex file than I expected.  Would you consider drawing this fresh in Inkscape?  That would certainly eliminate the problems of the file conversion - the many 2-node path segments.  If you would consider that, that would be my strongest suggestion.  We certainly can help you learn how.

If not, we can get there from here.  It's just going to take some work.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 20, 2018, 12:40:08 AM
I'm sort of interested in both ways.

I really need to learn inkscape anyway. I make plumbing parts etc as part of my job. Another thing the Boss wants me to learn is p&id diagrams (Like a circuit schematic for plumbing, I do electrical drawings too!). Google tells me inkscape is great for these too. As well as multiple uses with freecad. And just being able to draw stuff. Maybe one day it will be easier to just draw the plans from scratch myself :D

I think there will also be many times I will need to fix a freecad exported document, when its not too bad this will probably be heaps quicker than a re-draw/trace over. Also I get occasional requests to re-work logo art etc, usually from a .pdf source. I have stumbled my way through a little, seems very similar problems as when freecad makes .svg.. Plus I'm in contact with the freecad .svg dev, so maybe I can help him fix the problem if I can learn inkscape for repairing the broken stuff..

Lets have a quick look at repairing just the lower rectangle and circle I failed to hatch. Then we can look at how to "trace" over the rest of the drawing to fix the really nasty bits. How does that sound?
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Lazur on August 20, 2018, 01:59:25 AM
Sounds great!

Just a reminder inkscape is not a cad program and it's accuracy is quite limited. In the svg output at the preferences (Shift+Ctrl+P) you can set more digits to be saved yet there is some hard-wired limit for the operations as well.
Resulting you can end up with like 0,0005 px differences opposed to typed in values in the top spinboxes.

Another main difference is inkscape is Bézier path based. Although svg can hold circular arcs, there is no gui to do so which is another great limitation for cad drawings. Here (https://pomax.github.io/bezierinfo/#circles_cubic) is a comparison between the two.


By the screenshots it did seem your paths were cut to smaller portions. Need to check those svg-s.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 20, 2018, 04:48:54 AM
Just in case it's not clear, even though you might have had every path closed in freecad, opening the file in Inkscape caused them to be broken up into individual segments.

I guess it sounds like you're more interested at the moment in fixing the freecad file, so I'll start with that.  There are some relatively easy ways to connect all the short path segments.  However, there are a lot of extra things in the file that you'll need to sort through, pretty much one by one, before you can isolate the path segments from everything else.

I'll mention some of those.  Also, I'm only going to focus on the mechanical drawing part.  You can figure out if you want to fix the rest of the document or not.



There are several paths, filled with white and with no stroke, here and there throughout.  Some of them correspond to paths that you actually want to keep, and some don't.  So you'll have to sort through and delete the ones that you don't want.  For the ones that you want to keep, you can add a stroke and remove the fill, and then you won't have to fix the path segments for those areas. 

See screenshots h1.png, h2.png and h3.png, showing the kind of detective work you'll need to do.  At first, you can't see this object (the bottom rectangle which holds the circle) because it's white (h1.png).  Add some color to it (h2.png) and you think you might see it.  But move it over a bit and switch to the node tool (h3.png) and you can see that it is a complex object.  Part of it, the tall, narrow part on the right is apparently underneath another white object or objects.  I'm guessing you'll want to delete that one, but you probably know best.

Just that much might persuade you that drawing it in Inkscape from the start might not be a bad idea.  But I'll show you some more of what I found, just to help you learn.

Looking at the corresponding rectangle at the top.  For some reason, that one looks more like what you might expect.  (h4.png)  I've added a wider blue stroke, just to show some things.  First, most of the path segments are joined, except for the bottom-left corner.  And literally, I find that out by dragging the nodes around to make sure there are 2 paths coming out of a node.  If a node only has a path associated on one side of it, the path is not closed there.  If a node has 2 path segments connected to it, the path is closed at that node.  Then I just Undo after I learn what I need to know.

1 - For some reason which I don't know, there are several nodes along the top edge of that rectangle.  Ideally, you'll want to delete all those in the middle.  With the Node tool, drag a selection box around all except the 2 at the corners, then Delete. 
2 - To join the nodes at the bottom-left corner, drag a little selection box around them.  (Since they are precisely on top of each other, you can only select one of them by clicking.  But dragging the selection box select however many nodes may be there - 2 in this case.)  Then Join selected nodes button on the Node tool control bar (or whatever the key shortcut is).
3 - Remove the fill.

Now, that path is fixed, and you no longer need the paths underneath (see h5.png) which are made of 4 separate segments.  In my screenshot, I have it moved to the side.  But actually, if you do that, how will you be able to get it back in the right place, after you delete the separate path segments that you no longer need?  Not very easily.  So instead of moving it over, while it's selected, do Object menu > Lower to Bottom (or this button on the Selection tool control bar  :m2b: ).  Now you can easily select the 4 segments (because now they are on top in z order) and delete them.

There are several more white objects scattered around.  You may have some idea where they are, from when you drew it originally in freecad.  But you could also use Edit menu > Find, to locate them all.  Or there's a new feature which I haven't used.  I believe it's Edit menu > Select Same.  I think with one object selected, that will select all the others like it.



Now for the 2 circles.  The top circle is whole.  But move it to the side for a moment, and you can see a circle made of several broken path segments.  They don't even look like they were ever connected together.  Here's the best way to delete those many segments, without having to move the circle over, and thus have a hard time getting back into place.  Or I should say, it's the technique I would use.  Others might have different approaches which they prefer.

1 - With Selection tool, drag a selection box around the circle.  This selects the whole circle as well as all the pieces underneath.
2 - Press and hold the Shift key.  The Shift key allows for multiple selections.  Actually you already have a multiple selection, but you're about to de-select the whole circle, so you need the Shift key to keep from  de-selecting everything.
3 - Click once on the circle.  Since the whole circle is on top, it will be de-selected.
4 - Delete.  This will delete all the many pieces below, and leave the whole circle intact.

The bottom circle....  Hhmm, it seems for some reason, the broken segments for this circle are on top of the 3 large segments.  To be able to select those 3 segments, I can't only suggest trial and error, clicking short distances apart around the circle, until you find the 3 large pieces.  Hold the Shift key, to make the multiple selection, one at a time.  If you accidentally click a tiny piece, click it again, to deselect.  Pay attention to the bounding box (dashed line rectangle around it).  The next time you click, click just outside where the bounding box was, and you'll probably select one of the 3 large pieces. 

I think I've given you the info you need to join them already.  After they are joined, and while it is still selected, click Object menu > Raise to Top (or this button  :mtt: ).  Now you can use the same technique as the other circle, to delete the broken pieces.



After you have removed all the white pieces, you should be able to relatively easily join all the broken pieces together.  (I mean about the mechanical part.  The parts of the drawing which create a document....well, I haven't looked at those parts yet.  Anyway, I would suggest using this extension, to join all the segments:  https://github.com/fablabnbg/inkscape-chain-paths

It can be done without an extension, but usually requires a bit of cleanup afterwards.  I haven't not used this extension myself, but I've seen good reports about it.



For the selection tips I promised earlier.  I suspect it was mostly those white objects which you can't see, are responsible for most of the problem.  However, it is hard to select objects which have no fill and only a narrow stroke.  You can adjust the precision of your mouse, so that Inkscape selects what is directly under the mouse, and not a few pixels away.  Inkscape Preferences > Input/Output > Input Devices > Grab sensitivity.  I have mine set at 2.

And just for good measure, a few more gems.

I'm not sure if you've run  into this problem yet.  But you might want to consider custom styles for your tools, if you didn't already see this.  https://forum.inkscapecommunity.com/index.php?action=articles;sa=view;article=15

And if size and precision is important (which I assume probably is) you might want to switch to a geometric bounding box.  (If you didn't already find that too.)  It does not include the width of the stroke, in the size of the object.  Inkscape Preferences > Tools, and check Geometric Bounding Box. 

Depending on your options, the stroke width might be scaled when you scale an object.  Therefore, the size of the object changes differently than you intended, if you're using the Visual Bounding Box option.  While the Geometric BB avoids that, you can also disable that option.  Inkscape Preferences > Behavior > Transforms, and uncheck Scale Stroke Width.  You can also find this option on the Selection tool control bar:   :ssw:



I guess we'll come back to the hatching after you've digested all this much.  Or maybe someone else will address it?

(click on attachments to make them bigger)
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Moini on August 20, 2018, 07:34:30 AM
Didn't read it all, but just wanted to suggest using the eggbot hatch extensions for hatching, they work pretty well:
https://github.com/evil-mad/EggBot/tree/master/inkscape_driver
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 20, 2018, 05:25:05 PM
Thanks Brynn for that detailed instruction.


I mostly understand what I am doing here. I have a partially fixed document attached. I have removed a bunch of junk, and have all the stuff I am happy with on the bottom layer. Stuff I don't need to edit is on top layer. Pretty confident I know whats going on here. Just rinse and repeat what i have done.
The mid layer has the bit I need to make into a shape so i can hatch it. (Help here on the forum is so good. I have shifted the goals back to the original: Hatch all the cut faces)

I'm interested in doing this both ways:

Repairing the existing drawing (This may mean going back to eg for hatching2.svg and doing some bits differently)
"Tracing" over the existing drawing to make a new one, almost from scratch.


First a few questions about what i did. Some of the result in eg for hatching3 may not be completely repeatable.. Although overall I am impressed with how easy this is so far. Only took me a bit over an hour for my first time to get from eg for hatching 2. to the attached eg for hatching 3. Cheers inkscape forum people :D

With the top rectangle. Why are we keeping the white box and getting rid of the 4 lines underneath? I intuitively wanted to delete the white box and join the 4 lines. Although i can see its easy to add a pattern and boarder to the white box, and I can't seem to get the 4 lines to join up to become a box... Maybe that has something to do with it.

You mention moving stuff to lower layers. I assume its ok to create them where they do not exist? Couldn't seem to move the objects without a layer to move too, and even with a new bottom layer added. the toolbar option didn't seem to work? I had to right click object and move to layer.

I can explain why some lines had many nodes. Like one end of each rectangle. This is because in the 3d model these are curves. They only look straight due to the view perspective of the drawing. So freecad made the curves, in case I want to change view angles. As I will need to dimension these drawings. I think it would be useful too keep the middle node so I can mark out the radius dimension if I need to.
This probably explains many of the other unwanted features too. Freecad has them all there, in case I want to change the view aspect.

Looking more at leaving the middle top node (assuming this will be handy to have later?) when I did this there where nome extra bits? the status bar called the  "cusp node handles". Then I found the node wasn't attached to anything. perhaps I am barking up the wrong tree here, but it would be really useful to be able to snap a line to halfway later on. So I can provide the radius measurement on the drawing. I don't actually need dimensions on this drawing. Its a practice run for a patent drawing. Just trying to think ahead for later.
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

Also had issues deleting the extra nodes on bottom rectangle. Deleting them removed the line across the bottom.
 [ You are not allowed to view attachments ]
I tried joining the nodes and it didn't work quite like I was hoping :???: :lol:
 [ You are not allowed to view attachments ]
So undid that and had a look on toolbar. Found join nodes with new segment. But it seems to have brought back all the nodes I just deleted.
 [ You are not allowed to view attachments ]
So I undid again. thats when I say I have bonus nodes.
 [ You are not allowed to view attachments ]
Could someone please explain whats happened here. I guess that I didn't look for stuff to delete well enough first? How do I better deal with this when it happens?

I'm interested in using the edit>find tool to find other bad bits. More information please :-| I tried opening it and clicking on objects. Seems to require text entry. I don't know what to write.
   While on this topic. I notice the white shapes are easy to see when .svg uploaded to forum or opened in image programs with no default background. Could I change or remove the inkscape white background to make finding this stuff easier?

When I was selecting nodes. something funny happened when I used ctrl+scroll wheel to zoom with mouse over the multi node line. It seemed to be selecting nodes? Is there a cheat sheet with basic mouse controls and keyboard shortcuts somewhere? This is not the first time the mouse/keyboard has done unexpected things. Sometimes they look like usefull things too. Except I have no idea whats going on. And no idea what useful thins I am not using...

When joining nodes using box select. I had trouble box selecting. Does the object with the nodes need to be selected or something? This was the only way I could get it to work....


With the chain paths extension. The description looks like what exactly what I want. Are there detailed pictorial instructions on installing and using? Say I want to make the threaded part into one shape and fill it?
The instruction in the readme seem to assume a bit more inksacape skill than I have...
This may also be useful with the eggbot hatch extension. I have it on my extension menu, but it doesn't seem to do anything...
I have put chain paths .py and.inx in my share inkscape folder. What do I do with all the other stuff that came with the extension zip?
How do I actually use the extension
? The readme has about 3 repentances on the topic and I only understand half of it.


Finally great tips at the end. I have set my BB to geometric. I'll look at custom tools when it comes up. Good to know about that trap in advance :D
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 20, 2018, 05:31:05 PM
Sounds great!

Just a reminder inkscape is not a cad program and it's accuracy is quite limited. In the svg output at the preferences (Shift+Ctrl+P) you can set more digits to be saved yet there is some hard-wired limit for the operations as well.
Resulting you can end up with like 0,0005 px differences opposed to typed in values in the top spinboxes.

Another main difference is inkscape is Bézier path based. Although svg can hold circular arcs, there is no gui to do so which is another great limitation for cad drawings. Here (https://pomax.github.io/bezierinfo/#circles_cubic) is a comparison between the two.


By the screenshots it did seem your paths were cut to smaller portions. Need to check those svg-s.


0.0005px error won't be a problem. But thank you for mentioning this. Most part manufacturers offer accuracy around 0.2-0.5mm. Freecad - inkscape scale is 1mm - 1px. No one will notice half a micron. If they do I will tip my hat to them.  :wink1: :lol: :rtfm:

Re the circles. Not quite sure what you are talking about. But circles, or portions of will need to be circular. If I have to learn some code or script for this I will. Because its important.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 20, 2018, 05:32:19 PM
Didn't read it all, but just wanted to suggest using the eggbot hatch extensions for hatching, they work pretty well:
https://github.com/evil-mad/EggBot/tree/master/inkscape_driver

Got it installed. I think. Its on my extension menu. Nothing happens when i select it. Have tried with and without object to fill being selected.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 20, 2018, 05:48:35 PM
Ooops.

I think I made a mistake in eg for hatching3.svg

eg for hatching3.1 attached.


We are looking at the middle layer. I want to make this shape closed and fill it. [ You are not allowed to view attachments ]
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 20, 2018, 07:25:31 PM
update.

I had a play with the chain paths extension tool. It seems to do what I want. It also seems I need further instructions using it.

See eg for hatching 3.2 attached.

I box selected the entire right zigzag line. Tried the chin path extension and got an error message.
 [ You are not allowed to view attachments ]
Followed instructions in error message and got a result.

But it didn't work completely as hoped. I got a series of conected bits. This is still great. Because wouldn't take too long to join the ends manually.
Except some bits look funny. With white sections.
Other bits had double up lines like the circles. Some are needed some not so much. thinking I should have deleted these earlier?
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

I think I will wait for further instruction before proceeding.

I'd also be interested in just tracing over this part. I don't actually know how to "Draw a single line" yet. Let alone draw a series of connected lines to make a complex fillable shape.... i should probably do something about this....
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 21, 2018, 09:22:46 PM
With the top rectangle. Why are we keeping the white box and getting rid of the 4 lines underneath? I intuitively wanted to delete the white box and join the 4 lines. Although i can see its easy to add a pattern and boarder to the white box, and I can't seem to get the 4 lines to join up to become a box... Maybe that has something to do with it.

It was just my first instinct to reduce the amount of joining of nodes as much as possible.  Since only one node needed to be joined, that's why I kept that one.  Plus my other instinct was to get rid of the white fills.  Of course that could easily be done by turning off the fill.  So either way is fine, in the end.

You mention moving stuff to lower layers. I assume its ok to create them where they do not exist? Couldn't seem to move the objects without a layer to move too, and even with a new bottom layer added. the toolbar option didn't seem to work? I had to right click object and move to layer.

Ok, the options  in the Object menu (also there are buttons on the control bar) Lower to bottom, Lower (1 step), Raise (1 step), and Raise to top, are for arranging objects in z-order within the same layer.  Those do not move things to new layers - only z-order within the same layer.

Looking more at leaving the middle top node (assuming this will be handy to have later?) when I did this there where nome extra bits? the status bar called the  "cusp node handles". Then I found the node wasn't attached to anything. perhaps I am barking up the wrong tree here, but it would be really useful to be able to snap a line to halfway later on. So I can provide the radius measurement on the drawing. I don't actually need dimensions on this drawing. Its a practice run for a patent drawing. Just trying to think ahead for later.

That makes sense to save the middle node for later.  At the moment, I don't know why that node does not seem to attach to anything.  It does happen from time to time, if you're doing path operations, that a node will be orphaned.  But more likely it is attached to something.  I'm not sure which file to look at, to be able to answer.  eg for hatching3.2.svg ?

Hhmm, in eg for hatching3.2.svg, there is no longer a middle node there.  If this question still needs to be answered, tell me which file.  Well, you can see from the screenshot that it's attached at least to the node to the right.

Those straight blue lines with a tiny circle on the end are node handles.  With those you can adjust curves....if it's a regular bezier curve.  There are some other kinds of curves, like with LPEs, where the handles either won't move, or moving them doesn't do anything.  But in a regular bezier curve, they can adjust the curve.

So whenever you select a single node, then the handles of the nodes on either side of the selected node are revealed.  Those associated nodes are not selected, but their handles are revealed.  That info might not be very relevant for your purposes, but it's a clue that that node is attached to something.

I have a feeling you still may be having trouble (or you were at this point) with selecting what you intended to select.  The eg for hatching3.2.svg file looks much cleaner than the first version though.  So maybe it's getting better.

I'm interested in using the edit>find tool to find other bad bits. More information please :-| I tried opening it and clicking on objects. Seems to require text entry. I don't know what to write.
   While on this topic. I notice the white shapes are easy to see when .svg uploaded to forum or opened in image programs with no default background. Could I change or remove the inkscape white background to make finding this stuff easier?

Sure, that's one way to do it.  Although I haven't used it yet (very new feature) I think Edit menu > Select Same might be easier than using Edit menu > Find.  For Select Same, you have to have one of what you want already selected, as far as I understand.  Ok yes, I just tried it.

In the top layer of eg for hatching3.2.svg, those long skinny rectangles have white fills, so select one of those, and do Edit menu > Select Same > Fill Color.  You'll see that there are even some 2-node paths which have a white fill assigned to them.  You can't see the fill, and it's really inconsequential that it has a fill.  But when you're doing things like you are, with different programs, having absolutely the cleanest and most basic file, with nothing unexpected, is really ideal to eliminate surprises. 

So while everything with a white fill is selected, I would remove that fill from everything.  The formal way to do it is that big X button in Object menu > Fill and Stroke > Fill tab.  But there's a neat shortcut....well probably a few, but here are 2.  See that tiny X chip at the left end of the palette?  That removes the fill of whatever is selected.  If you hold Shift and click it, that removes the stroke.  Or another way, place your mouse over the Fill bar in the bottom-left corner of the Inkscape window, right-click > Remove fill.

When I was selecting nodes. something funny happened when I used ctrl+scroll wheel to zoom with mouse over the multi node line. It seemed to be selecting nodes? Is there a cheat sheet with basic mouse controls and keyboard shortcuts somewhere? This is not the first time the mouse/keyboard has done unexpected things. Sometimes they look like usefull things too. Except I have no idea whats going on. And no idea what useful thins I am not using...

Help menu > Key and Mouse Reference  :)

When joining nodes using box select. I had trouble box selecting. Does the object with the nodes need to be selected or something? This was the only way I could get it to work....

Yes, the nodes need to be showing before you can select them.  And that means that the path needs to be selected with the Node tool.  So to select nodes, first switch to the Node tool and select the path  (Or select the path with Selection tool and switch to the Node tool).  Boom, there are the nodes, and now you can select them.  Partly that might have been my fault.  It's hard to judge someone's skill level, and on some things you seem more advanced, so I might  have left out the step to switch tools.

I have put chain paths .py and.inx in my share inkscape folder. What do I do with all the other stuff that came with the extension zip?

As far as I know, it doesn't matter.  Some instructions I've seen seem to leave them in the Downloads folder.  I keep them in my extensions folder.  But you have to remember that the PY and INX files have to be in the extensions folder, and not in a folder in extensions folder.  Because when you download the extensions, often they have a few folders.  But if you don't take out the relevant files, and put them in extensions folder, that extension won't show up in the menu.

How do I actually use the extension
? The readme has about 3 repentances on the topic and I only understand half of it.

As far as I can tell, you just select all the path segments that you want to connect.  In your case, where the paths are all separate because of just opening in Inkscape, the nodes are probably already on top of each other.  So the distance between nodes might be irrelevant.  I'm not positive about that, just guessing.

The first few times I tried it with your file (which is the first time I've tried to use it) I had used Select All, so I had a lot of the extra stuff selected.   I've been waiting for you to create the cleaner file, and I'll try it again.  With a very clean file, select all should work.  But this file may just be too complex, and you'll have to select section by section, and run the extension a few times.

I think I mentioned before that you don't have to use that extension.  If the file is very clean, you should be able to Select All, switch to the node tool, select all again (selects the nodes) and click Join selected nodes button.  I thought the extension might work in your file without having to clean it up, but that didn't turn out to be the case.


But it didn't work completely as hoped. I got a series of conected bits. This is still great. Because wouldn't take too long to join the ends manually.
Except some bits look funny. With white sections.
Other bits had double up lines like the circles. Some are needed some not so much. thinking I should have deleted these earlier?

I think I will wait for further instruction before proceeding.

I'd also be interested in just tracing over this part. I don't actually know how to "Draw a single line" yet. Let alone draw a series of connected lines to make a complex fillable shape.... i should probably do something about this....

Now that you have a much cleaner file, I'll look more closely at using the extension.  I'll post this much, to answer your last questions.  Then I'll try the extension again, and look for these problems, and try to figure out what to do about them.

I made a video recently to introduce someone to tracing using the Pen/Bezier tool.  It's just a very brief introduction, and not a full tutorial for the Pen tool.  It's attached.  The video makes a blue circle whenever I click the mouse, but it doesn't make a double-blue circle for a double-click.

Click once to start the path.  Click once to drop a node.  Double-click to end the path.  I usually draw a new path with all cusp/corner nodes (they are diamond shaped....I think all your nodes are currently corner nodes) and then I come back later with the Node tool and change the node type and/or adjust the nodes, or node handles as necessary, to fit the path.  Or you can drag the path itself with the node tool, to adjust the curve.

Or, if you do a click-drag with the mouse, with the Pen tool, it will drop a Smooth node (square shaped nodes).  Personally, I find that very hard to control in a precise manner.  So that's why I always set corner nodes and come back later to change the node type and/or adjust the curves

In the situation where you need those grooves to indicate screw threads....and given the precision you need....that might be very tedious to trace.  I might be tempted to draw those threads as sharp points at first, and then come back later to make them curved.  Well, unless they technically are not curved....I guess I haven't zoomed in that close yet.  I might have more on that later.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 21, 2018, 09:52:43 PM
Ok, in eg for hatching3.2.svg, have you already used the extension to join some nodes?  You're going to have to go back to the original file, and make sure it's all cleaned up before joining nodes.  It appears there were some extra paths in the screw threads area, and sometimes it joined one path and sometimes it joined another.  I apologize that I didn't find this earlier.

Attached is a screenshot where I've pulled some of the nodes apart to show.

I'll go back to the first file that I looked at, and try to find all the problems, and how to fix them.  I'll be back shortly.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 21, 2018, 11:07:04 PM
A couple more screenshots.  h8.png shows what the path looks like at first.  h7.png shows all the many pieces which create what you see in h8.png.

Not all of those pieces are needed to make the a single path.  And you can see at the bottom that there are 2 paths overlapping.  Do you have any clue what might be responsible for the double paths?  I know earlier you thought the 3 part circle was because of the viewing angle in freecad, so I guess it's possibly the same explanation here.  But unless there's some way to avoid that from earlier in the process, I don't know any way to discover them, except by going through the file, one path at a time.

Oh, I just made another observation.  It looks like every other diagonal path is doubled - one side of each V, in other words.  That should help.  I could be wrong about this, but as far as I can tell right now, it's the bottom path which is correct.

Yes, if I were doing this, the first thing I would try is to go through and delete the top path of all the longer overlapped paths.  For those several paths in the inner curves, it appears to be the 2 smallest segments which are not needed.  So I would go through and delete the top path of the longer segments, and the 2 smallest paths of those in the curve.  That should make the file ready to connect nodes.

I'm speaking of using eg for hatching 2.svg.  Also, I've discovered that you can just delete everything with a white fill, and not lose anything.  That's very fast - just a couple of clicks, including Select Same.  Knowing what I know, I could have this file ready in 5 or 10 minutes - just to give you an idea.  It might take you longer.  Let me make steps for you.

1 -- Open eg for hatching2.svg
2 -- Ungroup once
3 -- Select only the mechanical part
4 -- Ungroup once more
5 -- Select one of the known white filled objects
6 -- Edit menu > Select Same > Fill color
7 -- Delete
8 -- Click on what appears to be the wider side of each thread (it looks wider because there are 2 paths on top of each other)
9 -- Delete
10 -- Repeat until you get through all the threads
11 -- With Selection tool, drag a selection box around the inner curve of the threads.  Try to identify the 2 smallest paths and delete those.  I don't know, it might turn out easier to use the Node tool to find them.

Oh I know.  One of them is a 3 node path, that should make one of them easy to find.  And the other one, the 2 nodes are almost on top of each other. The path is so short it almost looks like a circle.  Those are the 2 that I think need to be deleted.  So far, looking at 3 different curves, they are all alike.  So hopefully they will be the same in every curve.

After you get all that done, show me the file, and I'll test both the Chain Path extension and the more manual way of joining nodes, to find out if one is better than the other.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 23, 2018, 05:19:20 PM
Wow. Thank you again for all the time you are spending helping me :D

Sorry i am a bit slow to reply. Lots to digest there. I'm working through it.

I am working on making a cleaner file now. I have done as you say. Selected a white fill. selected same fill colour and deleted. That was indeed a very nice way to get rid of a good amount of the junk.

Then I did the circles. Grouped the 3 part one and removed junk from both circles.
So far about 1-2 minutes :D

Then on to the threads. Did first of 4 threads in about 10-15 min. Most of that time being spent selecting the first few bad bits. (Yes i am still having trouble selecting stuff correctly, but its getting better, I'm nearly over the steep part of the learning curve)

While I was deleting threads I was looking at how each extra bit has geometric copies all over the page. Like the 3 node curves on the threads. Tried to use inkscape GUI to search for matching geometry. Failed.
Opened .svg in text editor (Gedit for ubuntu, notepad for windows, don't know for mac) and had a look for the object id of one of the 3 point curves. ctrl+f let me search for it and find it in about 10 secs.
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

Then I had to do some detective work, because I'm not a coder....
 It was easy to see the group. Trial and error searching for different parts of the group and finally I found the bit that describes the arc. I know I'm right because there are 8 the same in the whole document. And thats how many curves like that I have left.
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

So I deleted those groups from the code. Saved with a new name and opened in inkscape. Looks good to me. All the 3 point curves on the lower right thread are gone. (I already did the top right in gui, left side still to go.)

Over all my coding skills are pretty equal to my inkscape skills. so this is taking me as long or longer to do in the text editor. Especially with the straight 2 node paths. Their code is not so obvious to hunt and destroy.

Wondering if there is a way to do a search for matching geometry, or even matching start co-ords. ie all my 3 node paths in a thread section have the same horizontal co-ord as a start point. Using inkscape gui? If not wondering if there is an extension maker around interested in adding this feature? I don't think it would be a big job...

I have attached a few screenshots of the process and the resulting document. I am now going back to document pre-text edit, and doing it the way I have been instructed. Because as mentioned before I'm getting better at selecting what I want and its not taking as long as I thought it would and looking at all that code makes my brain hurt...

I'll be back soon with the cleaned up document. :D
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 23, 2018, 05:54:12 PM
Wohoo!

I think I have all the junk deleted. eg for hatching 4.3 should be all clean. I even checked the form part and am confident its pretty good :xf2:

This 3rd or 4th time around I think it took me maybe 10-15 min to delete all the junk in the entire document. Using GUI only with no text edits.

Still having trouble selecting stuff, but developing intuition about why its not working and moving forward :D Just need to do it wrong a bit more to learn  :b1:

Now all I need to do is close up all the shapes so I can apply fill of my choice. :beg: :xf2: :beg: :xf2:

I'm going to have a try at that myself while I wait for further instruction :D :help2: :help2: :help2:


Since I have a few attachments to spare, I will explain about the junk lines on the threads.

If we look at a thread  in freecad and zoom right in on one of the problem areas.
 [ You are not allowed to view attachments ]

Then we can see edges and faces.
Here I have selected the edge in green
 [ You are not allowed to view attachments ]

and here the face is selected in green
 [ You are not allowed to view attachments ]
Here is the face still selected from a different view angle.
 [ You are not allowed to view attachments ]

So the problem is that freecad draws everything it sees. Including a few bits I don't always want. Considering the Tech Draw workbench is only a year or so old. I think its doing pretty well. Now I have a better idea on whats happening I may be able to assist the developer of the drawing module in improving things :)

Until then, I now have almost enough inkscape skills to fix any problems. Vay!!

I'll be back soon with some bad attempts at making closed shapes and filling them. :2tu:


Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 23, 2018, 08:56:07 PM
Wohoo again :D :-D

I think i am almost there.

I have a bit of a layer problem though.

I joined up all the bits in my last file with combined chain tool and manually selecting single points. Managed to fill all the areas :-D.

 Found a couple of bad node I had missed and added a few bits back that I may have deleted. Lots more stuff making sense and I am getting better selecting stuff.


Now my problem is that some areas need to cover other areas and they don't. If I can fix that I'm good to do what I need. You should be able to see what I mean in the attached files.
Hatches and fills etc on one layer/area are intersecting hatches on another layer/area.. There is also a new rectangle. This is just for the little corners that stick out. but it needs to be same pattern as 2 circles. to represent a single surface. I'm happy to shift+ctrl+v to match the areas that need to be matched.

Just need to get stuff on top fully blocking stuff under it.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 23, 2018, 11:21:58 PM
WOHOOO

I did it  :yay: :hd: :ur: :th: :ty1: :hd: :yay: :clap1: :2tu:

I used ctrl+d to duplicate a few bits. Set one copy to white and the other to pattern. then shuffled the z-stacks and layers around a bit and its looking great :)

Eg for hatchin5 attached.

About the only thing I might like to do is to gradient the pattern on the two rectangular areas with vertical stripes. So it looks more rounded, but that would be a bonus.
Normally I'm not sure I would pattern those faces anyway.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 25, 2018, 07:39:50 PM
Very nice work - congrats!

The only question I think you asked was about some way to find/select objects with the same geometry.  If it's one of the vector shapes, rectangle, ellipse, star, spiral and maybe 3D Box, yes, as far as I know.  There might be a way to find those 3-node paths using Find dialog.  I've been able to do it in my own file, but I didn't try in your file.

In the field labelled Find, you can enter XML code.  I've done that to find everything with the same fill or stroke color (that was before Select Same was invented).  I think I might have used stroke width once, too.  I just copied the code from the XML Editor.  It's probably just a matter of finding the right Properties, copying the right bit of code, and setting up the options in the dialog correctly

I have a feeling the Find dialog can do much more than I'm aware.  I could only refer you to this tutorial for that dialog.  That feature (Find dialog) is not covered in the manual (which is outdated), but this comes from an excellent series of tutorials.  Hhmm, I don't immediately see how to make a link to the specific page.  But this is the issue of Full Circle magazine (where the series runs):  https://fullcirclemagazine.org/issue-122/  Open the PDF, and the table of contents is on the 2nd page (after the cover).  Then just click on the Inkscape article.

Actually it might help you to read the whole tutorial!  It covers both ways of finding objects that I've mentioned (Select Same and the Find dialog) and probably with much more detail.  But it also covers another way, which I haven't learned how to use yet - Selection Sets.  I don't know if it would help with those 3-node paths or not.

In any case, I was a little confused why you were using a text editor to find those 3-node paths.  To me, it would be faster to just delete them one by one, than dig into the code.  (Ungrouping should have taken care of the groups.  But maybe you forgot?) 

But I am shocked that they all had the same values for the d attribute!  I always thought those numbers were coordinates.  But they must be something else.

In eg for hatching5.svg, I notice one anomaly which is caused by an open path (well, 2).  If you zoom in, you can see in some places on the right side, in the largest object, the pattern seems to have a white line going across it (top to bottom), and in other places, where the white area seems to have a black line going through it (or dashed black line, seemingly).  But it's all caused by the path being open in 2 places. 

I'll challenge you to find where the nodes are not connected.  You can follow the line.  It doesn't exactly lead directly to it.  But you can follow the angle of the anomalous line, and find the right nodes.  If you need help, I'll tell you where.  But I think you can find them  ;)

Also, both the top object with the pattern fill, and the bottom one with white fill, have this same problem.

Not a problem....I don't think.  But I'm just curious why you have some groups of 1.

I just noticed the object on the very bottom, a rectangle, most of which is hidden under the white fill.  Are you happy with that arrangement?  Or would you rather not have it overlapped, and instead have objects of those specific shapes, the parts that are showing?  It would not be very hard to do that, if you like.

Oh, and also, you could edit the patterns to be white with black stripes, and not have to have a whole white object underneath.  If that would be helpful.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 25, 2018, 10:21:07 PM
Yep I know about the 2 points nodes not joined. Spent ages trying to join them unsuccessfully. Although just went back and got them :). Not sure why top one didn't work before, But had to do bottom one all the way to the end. I had been trying to join it to a node not at the end of the other line. Which seems Like an obvious mistake.

Not sure about groups. But I guess I could group same or similar elements for easy organization? Like white background and stripy fill as a group. May also be useful to group actual parts and put in individual layers. Might make things easy for exploded views etc.

Would be nice to not need white backgrounds for stripes also.

With the rectangle on the bottom. Do you meant the bottom layer? That one is just there for the little corners and edges that show, but if I could make it also visible through the circular holes that would be cool. would save me a few extra elements.

Finally, with the two matching rectangles. Would be super awesome if I could make the pattern tighter near edges and more spaced in middle, with a gradual change. So it actually looks like the internal cylinder view that it is.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 25, 2018, 10:48:36 PM
Ok, I can explain how to do those things.  Unfortunately, I have to log off right now.  I should be back tomorrow evening or night.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 27, 2018, 07:13:55 AM
Yes, grouping is used to keep objects together, for whatever reason.  I was just curious why you had a group of 1 (a few of them).  That means there's only one object in that group.  In eg for hatching5.svg, select one of the long, skinny rectangles on the sides, and look at the status bar.

I thought we had eliminated all the groups a long time ago.  So that would mean you had created the groups of 1 on purpose.  But now that I think about it, I think I had noticed before that you had forgotten to ungroup previously.  So probably the groups of 1 were already there, and you didn't make them.

There's more strangeness with groups as well.  The circles are each a Group of 3.  That would mean there are 3 objects in the group.  But when ungrouped, there appears to be only one object there, identified as a Group of 1.  If I use Objects menu > Objects to sort it out, I see that the other 2 objects are each a Group of 0.  I have no idea how that is even possible.  No clue why Inkscape would even allow it (not to mention how that actually works, haha!).  To my knowledge, there is no way to make a Group of 0, and I don't know how it happens or what it means.

In the interest of having the cleanest file possible, it's probably better to ungroup those.  The groups of 0 can't be deleted on the canvas because they can't be selected.  But using the Objects dialog, you can select and delete them.  Note that the white circle underneath the circle with the pattern fill is also a Group of 3.  So once you ungroup them both, and get rid of the groups of 0, you can group the pattern circle and the white circle, if you like.

It's going to be harder than I expected to have a white background as part of the stripe pattern.  It can be done, if necessary.  But as far as making it easier to create different stripe patterns easily, that would make it much harder.

In Inkscape, making a stripe pattern is not as easy as you may have found it in the cad program.  In Inkscape, the length and angle of the line determine the spacing.  The patterns that you are using are made using the Rectangle tool....  Or I guess that's assuming they were made with Inkscape.  I think you said you got them from an Inkscape extension?  And it looks like they are simply long, skinny rectangles, rotated. 

Actually, I was a little surprised.  Just looking at the stripe pattern of the main large object, I thought they were 45 degrees.  But not quite -- they're 41.319 degrees!



But I can still show you how to make the bottom object, which is now a rectangle, into a shape which consists only of what's visible.  First, if you want that bottom rectangle to show through the holes, you need to make holes in the rectangles.

1 -- Ungroup those 2 circles, if you decided to group them (after getting rid of the groups of 0)
2 -- Select one of them and Duplicate
3 -- Hold Shift and click on the top rectangle (you should have one circle and one rectangle selected now - check status bar to confirm)
4 -- Path menu > Difference
5 -- Repeat that process with the 2nd rectangle and another circle

Now, if you move the remaining circle out of the way, you should be seeing through both rectangles.  But be sure to put the circle back, if you move it to take a peek.

6 -- Repeat the above process with the other circle/rectangle instance

Now to remove the bulk of the bottom rectangle.

7 -- Select the large main object and Duplicate
8 -- Hold Shift and click on the bottom rectangle (now you should have bottom rectangle and the large main object selected
9 -- Path menu > Difference

Now, if you move everything out of the way, the screenshot shows what's left.  Depending on which circle you originally duplicated in step 2 above, and which circles you used in the Difference operations in step 4, you might have a while filled circle left.  Somehow I ended up with a pattern filled circle (not sure how).

Anyway, of course, you can't leave everything out of the way to do the last steps, because there really aren't any landmarks where you could snap them precisely back into place.  Fortunately, Inkscape provides a way to select things that are hidden behind something else, because you'll need it.

10 -- If what was originally the bottom rectangle, whatever is left of it, isn't still selected, select it again
11 -- Path menu > Break Apart  (I know you can't see what this does.  But you could make a duplicate to the side, where you don't move the other pieces back into place, so you can see.)
12 -- Deselect everything
13 -- Position the mouse below the remaining circle, and not on it.  (Or if you're working on the top rectangle, put the mouse above the circle.)    This is going to select that rectangle on which the circle currently is resting.
14 -- Hold the Alt key while you click 3 times (the first click selects the top rectangle, 2nd click selects the one below it, and the 3 click selects the one you need to get rid of) (if you watch the left end of the status bar, known as the Style Indicator area, you can see by the fill and stroke what you're selecting, as you go down)
15 -- Release Alt key.  Now hold the Shift key and click on the remaining circle (status bar should say that 2 objects are selected, and the bounding boxes should indicate which ones).  Note that I learned how to do this before the Objects dialog was invented.  You had to depend on your memory, the status bar, and the bounding boxes as clues to be sure you had the right objects selected.  Now I guess new users will start to depend on the Objects dialog for this.

16 -- Ok, assuming the correct objects are selected, do Path menu > Intersection.  Your circle should still be there.  If it's not, something went wrong.
17 -- Select the circle, hold Shift and click the leftover edges of the original bottom rectangle (2 objects selected)
18 -- Path menu > Combine, or Grouping them would work as well.  This keeps them together, so you don't accidentally misalign them.

Now, when you go to repeat this for the top circle, that little rectangle which is remaining from the original bottom rectangle will still be by itself (resulting from the Path menu Break Apart in step 11).  So repeat steps 12 through 18 for the top circle.



For your last question about making the stripes closer together on the sides, to give the appearance of a hollow tube in cross section, that could only be done manually.  Not by using a pattern, but by drawing a series of paths (or long, skinny rectangles) and manually placing them.  If you know some mathematical way of calculating how they should be placed, then it would be possible to place them according to that.  But still manually
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 27, 2018, 10:46:49 PM
There's more strangeness with groups as well.  The circles are each a Group of 3.  That would mean there are 3 objects in the group.  But when ungrouped, there appears to be only one object there, identified as a Group of 1.  If I use Objects menu > Objects to sort it out, I see that the other 2 objects are each a Group of 0.  I have no idea how that is even possible.  No clue why Inkscape would even allow it (not to mention how that actually works, haha!).  To my knowledge, there is no way to make a Group of 0, and I don't know how it happens or what it means.

With the lower circle. Remember it was 3 parts and I joined them. I may or may not have grouped them together before joining nodes. I can see how that might cause incorrect properties to appear. Looks like I should be paying more attention to the status bar down the bottom. I have hardly been looking.
No idea about the other groups. Pretty sure I ungrouped twice before doing anything else. Looking around I see many objects are still groups of 1 and require 2 more ungroupings to become nodes. I'll pass this on the the freecad drawing dev. It may be useful... I'm still not completely understanding the significance of groups, but reading up on basic mouse use etc has revealed some interesting stuff, like double clicking to enter a group.... There are so many layers within layers in this program.... I see how useful it is, but I think this may be part of my problems selecting stuff.
 
Anywhere thats got a good explanation and examples of all the terms like layers, groups, nodes, paths etc etc? I think learning more here would help me a lot.

In Inkscape, making a stripe pattern is not as easy as you may have found it in the cad program.  In Inkscape, the length and angle of the line determine the spacing.  The patterns that you are using are made using the Rectangle tool....  Or I guess that's assuming they were made with Inkscape.  I think you said you got them from an Inkscape extension?  And it looks like they are simply long, skinny rectangles, rotated.

Actually, I was a little surprised.  Just looking at the stripe pattern of the main large object, I thought they were 45 degrees.  But not quite -- they're 41.319 degrees!

Yep. I have looked into patterns quite a bit. Tried making some from scratch with average results. Have used the ones from the tutorial (which are made using the python script that came with the tutorial) , and will try that script to make some custom ones once I have a better idea what I want. Never got the eggbot extension working, but not fussed as the hatches where a bit rough looking anyway.

But the patterns in eg for hatching5 are all default inkscape patterns I adjusted with node tool then copy pasted where I need a matching pattern. The angles where all eyeballed... I was a concreter for 13 years and have been engineering for 8. Over 3deg out is pretty rough for me ;p I literally just (5 min ago) repaired a bent carpenters square by eye and got it within 0.015% first try :)
I noticed when copying pattern properties,  sometimes the little x copies into a new spot and I have to move it onto the other little x to get the patterns to align. Is there a way to snap the 2 x's together a bit faster than zooming in and mouse manipulating? or even group them all as one? i managed to box select circle or square for 2 matching patterns once, and adjust them together, but can't seem to repeat it.

Re white (or black) background. I'm happy with my duplicate method. Gives me quite a lot of freedom to adjust stuff and its quick and easy. Although would be great to be able to change the color of the stripes. Would prefer a clicky way to do this, but could xml edit if I knew where to find the #number. Had a quick look in xml. there was a lot of data for the pattern! Maybe there is a better way? How would I make the lines blue on a red background for eg?


Anyway, of course, you can't leave everything out of the way to do the last steps, because there really aren't any landmarks where you could snap them precisely back into place.  Fortunately, Inkscape provides a way to select things that are hidden behind something else, because you'll need it.

I've been using layers here. I just make a spare layer and make it invisible. Then move stuff I want to preserve for later there until i have a better place.
I have been working through the actual images I need for manufacturing and patents etc (which I obviously can't publish online) and I found it very useful to make a layer for each part, and sub layers of parts with background patterns etc. Makes it easy to use one drawing for multiple purposes.

I've also selected the top object, moved to lower in z stack, then shift selected the new top object :) Its not too bad.


The difference tool is handy too! Like freecad boolean operations :D In this case all I would do is make the hole in the rectangle. As the lowest pattern rectangle actually represents a surface on the inside of a pipe. I may want to do images of each part or an exploded view or something. So makes sense for the drawing to be as close to the 3d/actual part as much as possible.

Some great instructions there. Thank you. I went through it all for the practice.  Even though some of it went a bit further than I needed.

I did find some issues with alt+left clicking. It didn't seem to do anything, not change in status bar... But the status bar gave me a good tip and I was able to scroll through layers with mouse wheel and alt+shift click to select other layers. Was really easy to just get a bottom layer too!

Really curious why after doing the difference on the circle and rectangle. You said to put the circle back where it was? Was this just because i wanted to cut through 2 rectangles and would need the (other) circle again. Or is it like a freecad Boolean where if I move one of the original 2 parts, after doing the operation, it changes the result part?
I must admit to having lost track of all my circles.. I have a white one and a pattern one I can now move away. as well as 2 rectangles with a hole so i can see the desired pattern in a lower layer.
I cant seem to find the circles used to make the holes in the rectangles. Did they get consumed in creating rectangles? Or have i lost them in a group or layer?

Also is the oder of selection important  with the path booleans (union difference etc etc)? I know in freecad if I want to subtract one part from another part for eg. It's important to select the bit you want to keep first and the bit to be cut away second. Things like difference and union are not so fussy, but sometime selecting the wrong part first will give you a problem down the track.



I have attached a new version. eg for hatching 5.2. I think I have found all the errors and fixed them. I have made the backgrounds all work how I like and finished it off by putting stuff in appropriate layers.

I have also added some dimensions. This was way over my head a few days ago. Came out ok. Wouldn't be too bad if I only had to add 1 or 2 dimensions. Could be time consuming to do many though. I think I still have room for improvement.

1. I can't seem to get font size to change in the text and fonts panel. Its stuck on 32. I try changing it and I can't apply (button grayed out). When I click away then click back. font size is 32 again. As you will see in attached doc. I want closer to font size 4... I had to scale it by dragging a corner with select tool +ctrl


2. my blue line and arrows are not very well done and are hard to get in the right place consistently across the document. I had some luck with align tools, but a few features I wanted missing. Mainly the ability to attach nodes to other nodes or lines. I made the 5mm dimension pretty good. But left a few problems with the 30mm dimension. I'm probably approaching this all wrong.

3. can I save an arrow as a clip art (publisher98 memories just came flooding back lol) or something. So I can re use them for speedy dimensioning. Or even better all 4 lines, 2 triangles and text. So all I have to do is click the 2 nodes I want to dimension and alter the text.


4. Is it possible to make 2 things. Say a pair of parallel lines. And make them stay the same? ie change one line and have the other change to match? So they always stay the lame length and parallel?

5. Also interested if there are any horizontal/vertical constraints that stay on? ie I can use the paraxial pen constraint to draw, or hold ctrl while moving a node. and I can align tool nodes to make a diagonal horizontal or vertical again if I move something badly. But can I make it stay that way so I can't easily change its angle again? 

I have added some screenshots to try and be clear about what I need. Is it possible to make a re-usable template to do this?

I also added an example of freecads dimensioning. Took about 30 secs to add those dimensions in freecad. Usually I would just do it that way before exporting .svg or .pdf. But sometimes I want to change stuff in inkscape or sometimes the extra bits/bugs freecad makes, prevent me from doing the dimension I want. ie in this document I can't do a radius or diameter dimension on the circles for some reason.

Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on August 29, 2018, 01:21:45 PM
With the lower circle. Remember it was 3 parts and I joined them. I may or may not have grouped them together before joining nodes. I can see how that might cause incorrect properties to appear.

If you did not ungroup them before you joined the nodes, yes, that could be the reason for the group of 3, where 2 of them are a group of 0.

Anywhere thats got a good explanation and examples of all the terms like layers, groups, nodes, paths etc etc?

There's a glossary in the manual, but it doesn't seem to be very comprehensive, to me.  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Glossary.html  However, the manual is extremely well indexed.  In providing support for other users, I go back and forth between the table of contents:  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Glossary.html and the comprehensive index:  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/ix01.html  to find whatever I need.

But you pretty much have to already know the vocabulary, before you can find things in the manual.  That's one of the bigger complaints about that manual, is that it's not well suited to help beginners.  (We had started down a path to create a manual more suited for beginners, but it seems to have stalled out lately.  Maybe it could be kickstarted pretty soon, I don't know.)

The angles where all eyeballed... I was a concreter for 13 years and have been engineering for 8. Over 3deg out is pretty rough for me ;p I literally just (5 min ago) repaired a bent carpenters square by eye and got it within 0.015% first try

I guess it's kind of surprising that you're making mechanical drawings by eyeballing!  But I'm not familiar with that field.  I guess in thinking of instructions I've seen for assembling household items, such as a shelf or desk or other things like that (put tab A into slot B, and etc), it's not that surprising, haha!!

I noticed when copying pattern properties,  sometimes the little x copies into a new spot and I have to move it onto the other little x to get the patterns to align. Is there a way to snap the 2 x's together a bit faster than zooming in and mouse manipulating? or even group them all as one? i managed to box select circle or square for 2 matching patterns once, and adjust them together, but can't seem to repeat it.

Hhmm, I can't seem to snap the pattern controls to each other.  They will snap to other targets though - such as nodes or guides, probably grids as well (although I didn't test).  But that's not particularly helpful.  What you would need is for guides to snap to the pattern handles, ideally.  That's probably a bug, although I haven't looked it up.

I guess the best you could do is drag a guide or 2 to where it visually intersects with a pattern handle, and then move the pattern handle slightly to snap to the guide intersection.  Then the other pattern handles will snap to the guide intersections.

As I said before, it may be that the cad program is easier to use for this.  I wouldn't be surprised if there isn't a feature request for better pattern controls.  And of course you could make such a request yourself, if there isn't one.  But who knows when someone might be interested to create those features.

How would I make the lines blue on a red background for eg?

Actually I've looked further into making a pattern with a particular background color, and it doesn't look like it can be done with Inkscape.  As far as I can tell, you always have to have a duplicate object underneath.  I did make a pattern using a solid background, but as soon as it was converted to a pattern, the background went transparent.

But you can change the stripe color.  Just select an object which contains the pattern.  Do Object menu > Patterns > Pattern to Object.  You might have to look around the canvas to find it, but you'll find the line somewhere.  Select it, change the color, and then do Object menu > Patterns > Object to Pattern.

I suppose there might be a way to change the color faster using XML Editor or a text editor.  Let's see....  Wow.  It's complicated, but I did find a way in the XML Editor, to change the color.  The keys are (1) take note of the pattern number (I was testing with a custom pattern, because it might not be possible to change a stock pattern color this way) and (2) expand the defs node in the XML Editor (on the left side of the XML Editor).

I found the pattern number in the defs section, but when I expanded that item, it showed some more pattern numbers (numbers which don't appear in the pattern menu in Fill and Stroke dialog).  With one of those numbers selected, the Value of the Style attribute (right side of XML Editor) showed yet another pattern number.  Back to the left side of XML Editor, I found that pattern number.  Expand that one, to find yet another pattern number.  The Value of the Style attribute for that one, shows a hexcode (#123456).  And changing that hexcode changed the color of the pattern on the canvas.

There's a good chance there's an easier way.  Maybe using a regular text editor, rather than the XML Editor??  But I don't have time to research right now.

Sure, you can use layers to make selections easier.  But Alt + click is always going to be easier and faster.  Practice makes perfect, as they say  ;)

I did find some issues with alt+left clicking. It didn't seem to do anything, not change in status bar

If you use Alt + click, and the status bar doesn't change, it means either there's nothing underneath, or there's an identical object underneath.  You can tell the difference by looking at the scale/rotation handles/arrows.  If there's an identical object underneath, the arrows won't change.  That's because you just selected the object underneath.  If there's nothing underneath, then the scale/rotation handles will change.  It's just as if you clicked a 2nd time on the object, on purpose, in order to change the handles. 

Really curious why after doing the difference on the circle and rectangle. You said to put the circle back where it was?

I said:

Now, if you move the remaining circle out of the way, you should be seeing through both rectangles.  But be sure to put the circle back, if you move it to take a peek.

I think you probably decided not to do the last few steps, but that last circle was going to be needed at the end.  If you didn't do the last few steps, you would not need that circle.

I cant seem to find the circles used to make the holes in the rectangles. Did they get consumed in creating rectangles?

Yes!

Also is the oder of selection important  with the path booleans (union difference etc etc)? I know in freecad if I want to subtract one part from another part for eg. It's important to select the bit you want to keep first and the bit to be cut away second. Things like difference and union are not so fussy, but sometime selecting the wrong part first will give you a problem down the track.

In Inkscape, it's not selection order, but z-order.  The object on top is that one that will do the "cutting", and it will always disappear.  As you said, it's sort of consumed during the operation.  Or sometimes I say it's "sacrificed".

I have also added some dimensions. This was way over my head a few days ago. Came out ok. Wouldn't be too bad if I only had to add 1 or 2 dimensions. Could be time consuming to do many though. I think I still have room for improvement.

Did you do that "manually"?  I think there's either an extension or LPE to help with that.  Let's see if I can find.....  Oh yeah, here.  Extensions menu > Visualize Path > Dimensions.

1 -- Unless you need some feature in Text and Font dialog, which is not on the control bar (in the main window) I would not use the dialog.  The text which size you want to change needs to be selected.  Use the dropdown menu, or else you can type the number into the field.  Press return after typing in a value.  (oops, I guess they call it Enter key these days, instead of Return - I'm from the typewriter generation)  (If you really want to use the Text and Font dialog, the text needs to be selected to make the Apply button active.)

Sometimes it doesn't change for me either.  If it doesn't change, try highlighting the entire selected text (with Text tool) first.  Change the font size,  and then it should change.  Note that the text tool, in general, is not super sophisticated.  If you need the text to be very sophisticated, use a desktop publishing program like Scribus.

2 -- If you want to make your own arrowheads, you can do that using Markers.  Or you can use existing Markers.  Select the path, then Object menu > Fill and Stroke > Stroke Style tab > Markers.  Choose whatever arrowhead you want, for whichever end of the path you want. 

Markers can be anything you want.  Draw, let's say a star.  Object menu > Object to Marker.  Look in the the marker menu in Fill and Stroke > Stroke Style tab, to find a new star marker.  Markers always come out black from the menu, but if you change the path color, the marker color will change too.  Inkscape places a marker at whatever nodes you choose.  If the path has 15 nodes, there's the start node, the end node, and 13 middle nodes.  Choose them from whichever menu, as needed.

Note that when you change the width of the path, the marke size changes exponentially, for some reason.  So sometimes you have to be creative with custom markers, if you need to change the path's stroke width.  Or else do it like you started, making the arrowheads as separate objects.

To answer your question about aligning objects, it sounds like it's about time for you to learn about Snapping.  I think I mentioned it before, but just in case, I can't do any better than the manual does in explaining it:  http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Snapping.html  In the situation you showed with the triangle and the end of the path, you'll want to set it up to snap nodes to the segment midpoint.  (Not sure if the manual covers snapping to midpoints, since it might be newer than the last manual update.  But once you start to get s napping, you'll get it on your own.)

3 -- I think I already answered this.  Use markers.  Or the Dimension extension.  Here's an external extension too, but I don't know if it works or how well it works.  https://github.com/Rutzmoser/inkscape_dimensioning  It might not even be the same thing as you need, but it sounds like it.

4 -- Cloning would make them stay the same length.  Change the parent and the clone automatically changes at the same time.  If they start out parallel, they should stay parallel.

5 -- I'm not sure if I understand what you're asking.  Normally things don't move unless they're selected.  It is possible to lock objects (or layers).  But it's tricky with locked objects, because they only way to select them again after they are locked, is with Objects dialog.  But I'm not sure that's what you're looking for.  Could you show an example?

Is it possible to make a re-usable template to do this?

You mean with the document-like background?  Oh yes.  Here's a tutorial:  http://libregraphicsworld.org/blog/entry/using-templates-in-inkscape  Basically, you make the template however you want it, and save it as an SVG file, in the user templates directory.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 30, 2018, 08:33:55 PM
Lots of great tips there! I'll be re-reading that all weekend :)


Really excited to see some measure extensions. had limited success in 5 min try. Will come back to that. They could be the answer i need if I can change its behavior and look a bunch. Its pretty slow doing it as is. Probably more steps than just drawing it from scratch... eg: path>visualize path>dimension, delete extra dimension, move to correct place, edit half the line lengths, colors and widths, path>visualize path>measure, move text, change font, create font background and colors and fix arrows to match my other arrows in use since last year...
vs
use pen with snap on, hold ctrl and draw 3 sides of a square, draw 1 more little line and clone, add arrows, add text and text bakground. Done.

But it will be awesome if I can change that and get the behavior described below to work...
I'm looking for a click/select 2 points then drag measurement system... Using menu drop downs in not really a good option as its so slow and hard to click on the correct dropdown etc.


Markers look really interesting too. Will have a play after posting this :D

 Clone will get used a lot. Thats awesome!! If I can mirror clone, a lot of stuff will only need to be half drawn :D:D

Snapping!!! This is what I need!  I could not get this to work at first. Been through everything on the first 2 pages of google result for [how to snap inkscape] they all show the same stuff but I could not get it to work for 2 hours of trying. Have checked its turned on in setting and on toolbar etc etc.

I eventually got it sort of working in unreliable fashion. Another few hours later and I'm still not understanding the constraints used or what should be on or off. Its added in a bunch of confusing behavior and now I'm back to really struggling to just select stuff i want or even click in the place I want at full zoom! gah.. I'll get it eventually. Freecad was like that too at first.... But once i understood the format a tiny bit it all started making sense.

If there is a detailed guide on these things with layman language and explanation on terms that would really help a lot. Sounds like I might have to apply the open source philosophy and create these myself? I've exhausted my search engines.... Freecad was the same too. 2 years later I am almost ready to do the tutorials I needed at the start.

But much much worse :( the snaps don't stick. Its just putting stuff down there, and not actually attaching it. Say I snap a line endpoint to to a triangle midpoint. then move the triangle. The line does not get longer. I can group or multi select and make it move the line, but thats undesirable..  I only want to move the snapped node. Not the whole line... Ideally the other endpoint on the line would be snapped to something else which is in turn snapped to something else, which is snapped to the drawing of the part which is locked and cant move. So the only option will be to make a line longer. Because everything else will be constrained.....

I'll try and explain again using how it works in freecad. I don't need it to work the same in inkscape, but suspect it could, as techdraw is basically made from inkscape code. Anyway anything equally fast and easy would be fine. (I just did 5 documents in freecad yesterday, then tweaked in inkscape a good bit. So far this is the fastest way and I will try to make a tutorial once I have some stuff sorted more in my head. Its actually a pretty powerful partnership, freecad and inkscape)


Normally I would just select 2 points to measure/define. Then click a button and the dimension appears (usually in a bad spot) with default appearance according to my settings..
 [ You are not allowed to view attachments ]

Then I just "grab" (click and drag) the number part and put it where I want. All the lines adjust accordingly. Everything stays square and parallel. The extra bits of line at the top of the offset lines don't change, the dimension line follows the text if i move it out. And the arrows stay exactly where they should...
 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

this is what I am talking about when i want to lock stuff down.... Lock node or a snap point so the spot the dimension lines attach to the part drawing are not going to move when I drag other parts/nodes/handles of that object. Or lock the length of a line and one endpoint, but leave the other end free to move.... I know ink-scape is not cad, but I think this feature would likely be available. I just don't know what it would be called.....

I want to lock attachment of the blue standoff lines to my part. Lock the arrows to the standoffs at a certain point from the end. Leaving the bit between arrows and part free to change length.
I think I have figured out most of it. But I can't get the snapped point to stick, and I cant seem to lock the length of a line segment.
If I could lock the extra length, lock both the 4 node snaps, and lock the dimension to part nodes. It would be pretty close to perfect with just 3 constraints.
even if I cant lock the line length. I suppose I could get rid of the little extra lines. Then i just need to be able to lock 2 pairs of node clusters together, and attach the text to the dimension line.

The end result should allow me to change the standoff length easily. Without changing any other dimensions or messing with the scale on my text, lines and triangles. To use a cad term, I want to limit the degrees of freedom. Which means to limit the amount of parts that can be moved (nothing to do with angular degrees in a circle). Down from over 20 moving things, to 2-3 things that can move per measurement line...

I want to be able to move the text too. If i can lock its center alignment with the dimension line but be free to drag it up and down the line, along with its white background. Without the z layers constantly re-ranging them selves. That would be a big bonus. (Any ideas on why my z layers and line widths are changing every time I move stuff would be very helpful!!)

But mostly I just want to change the offset length, without changing anything else and keeping it all attached. Only takes a sec to fix the text, maybe less if the snaps will lock.. But selecting 4-10 points and manually adjusting and re-snapping every time I want to tweak something is really slow and tiresome.

I have attached a new .svg with better 30mm dimension. Lets see if we can lock the other points down, so I can change the ofset with one drag...
By oftest i mean the distance the measurement line (the one with the text on it) is from the part.
we can loose the "tails" for now. Lets just look at 3 sided rectangle, arrows and text.





Also the alt+click thing still not working. It doesn't seem to do any action for left or right click. But it does change status bar info if i hold alt. According to status bar instructions I have to alt+scroll. Which is better because i can go back and forth. This may be an Ubuntu thing as alt is used a lot by the os. i was surprised pressing alt at all didn't pop me straight out of inkscape into OS features!

I also tried alt+D and again surprised it didn't start the first program in the os starting with d, but instead actually cloned the object. Then I tried it later and sure enough it started another program thats name starts with d.

I'm happy to look into this at a later date. For now I can use it ok :) I think it depends what part of the inkscape window I last clicked, as well as where the mouse is. This is really cool. Most Linux programs can't use alt at all for any function on Ubuntu. Because the OS has already taken it.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: MongrelShark on August 30, 2018, 08:42:32 PM
Re markers.

Sort of what I am looking for. Except getting them in the right place and pointing the right way seems to have a few issues....
 I think faster to just draw them from scratch and attach some nodes..... :b1: :b1: :b1: :b1: :b1: :b1: :b1: :b1: :b1: :help2:
 [ You are not allowed to view attachments ]
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Lazur on August 31, 2018, 01:59:15 AM
Check the latest de4velopment build -there is a new dimensioning line extension that can generate dimensioning lines that update with resizing the measured object.

Sorry for not following through all of this wall of text but it's quite a novel.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Moini on August 31, 2018, 05:12:53 PM
Lazur, can you explain a bit more about that new dimensioning extension? I don't remember having seen anything like that. Maybe the LPE is what you mean? http://wiki.inkscape.org/wiki/index.php/Release_notes/0.93#Measure_Line_LPE
Title: Re: Help with hatching on mech drawing - freecad related
Post by: brynn on September 01, 2018, 03:36:43 PM
Yes, that's true that snapping only positions things - with precision (well, maybe relative precision, depending on your needs).  It does not glue them together permanently.  Let's say you have 2 paths, and you drag one node over and snap it to a node on another path.  If you later want to move those 2 nodes,  you have to select both nodes (by dragging a selection box, since by clicking you can only select the one on top).  Remember that both paths have to be selected first, before the nodes of both paths are available to be selected.  And also that you have to use the Node tool.

As I said, there's a learning curve for snapping.  It was probably a couple of years before I felt like I really, really understood it.

Yes, it's true that Inkscape is not a cad program and does not try to be.  There have been many requests for more cad-like features, but I suspect the developers aren't sure how to fulfill that request.  Devs don't want to make Inkscape into a cad program.  Likely these features would have to be added via extension, although I don't really know what the possibilities are.

I have to say, I'm starting to get tired of all the requests for cad features.  If people want cad-like features, why don't they just use a cad program?  I don't understand why they want Inkscape to provide those features, when cad programs already provide them.  Although I've never used a cad program, so I don't really know what they want.

It's possible that you might need to  make some kind of change on your system to make the Alt key work.  I know you do on Macs.  Oh right, you have to on Linux too.  Here try this info:  https://inkscape.org/en/learn/faq/#alt-key-doesnt-work-linux

I'm not sure about your trouble with Markers.  They always and only appear where there is a node.  If you want a marker at a particular place on a path, put a node there.  Markers don't exist without a path.  If you want for example an arrowhead, which does not point at the same angle as the path, you'd have to make a custom one, and draw it at the correct angle.

Or else just draw your own triangles and snap to the path, without using markers.

Title: Re: Help with hatching on mech drawing - freecad related
Post by: Lazur on September 02, 2018, 09:49:16 AM
Lazur, can you explain a bit more about that new dimensioning extension? I don't remember having seen anything like that. Maybe the LPE is what you mean? http://wiki.inkscape.org/wiki/index.php/Release_notes/0.93#Measure_Line_LPE

Yes, lpe. My bad. Beta-tested it and added in some suggestions -now that the freenode channel is private, it'sout of my current scope.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Moini on September 02, 2018, 11:38:17 AM
Do you need help registering? I had to go through the process, too. If you know how, it's not that difficult.
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Lazur on September 02, 2018, 12:08:21 PM
Getting offtopic on this.
Off-Topic: show
Thank you for your offer but it's rather laziness. Drafting like a workaholic these days for months now I haven't got much time to participate lately in such efforts -although with my ever unsatisfaction with the cad software I'm using I should really dig into foss programs.
By the way it supposed to be another vectors meeting this weekend right?
Title: Re: Help with hatching on mech drawing - freecad related
Post by: Moini on September 03, 2018, 04:10:12 AM
Off-Topic: show
So much work! I don't know about the vectors meeting, sorry. Brynn might. I haven't seen any announcements on the mailing list or on gitlab. I only know that the board meeting has been postponed to after the Hackfest. Don't know if Vectors will want to keep them together or not.