Select and offset

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules
Always indicate Operating system, QCAD version
Attach Drawing files, Screenshots
Post one question per topic.
lynsg
Newbie Member
Posts: 6
Joined: Fri Sep 13, 2019 7:32 am

Select and offset

Post by lynsg » Fri Sep 13, 2019 8:37 am

I would like to change from Blender to Qcad, and have a Qcad Pro trial, 3.22 on Mint 18.3. The first job will be to take this dxf file imported from DelftShip, move the curved lines a certain amount (deleting the original lines) and copy the straight lines a different amount (keeping the original lines).
r7-p1-01.dxf
(127.91 KiB) Downloaded 135 times
My first problem is setting the selection - after selecting a polygon, nothing will set it. The enter key does nothing, escape cancels the selection, right mouse click and middle mouse click both cancel the selection. Snapping to the first click still leaves the tool trying to extend the polygon when it should be setting up the offset. The docs at https://qcad.org/doc/qcad/latest/reference/en/ give no clue.

Secondly, can an offset be made from a selected polyline? The docs only mention doing this from the entire shape, not a selected portion.

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Fri Sep 13, 2019 8:59 am

lynsg wrote:
Fri Sep 13, 2019 8:37 am
after selecting a polygon, nothing will set it
When I do a polygon select (TP) around your shape,
or a rectangular select (TR),
or a draw select or select all for that matter.
I get 1 poly on layer_1 with 681 vertexes.

Remark that for the first 2 methods one can change the mode of selecting.
In my case 'replace current selection' was active.

PS: Remark that you have to end the polygon selection with R-click.

Regards,
CVH
Last edited by CVH on Fri Sep 13, 2019 9:12 am, edited 1 time in total.
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

User avatar
andrew
Site Admin
Posts: 7204
Joined: Fri Mar 30, 2007 6:07 am

Re: Select and offset

Post by andrew » Fri Sep 13, 2019 9:09 am

If I understand you correctly, you are trying to select a portion of a polyline. This is not possible. If you need to deal with portions of a polyline, you'd have to divide or explode it first.

In your case, I'd proceed as follows:
- Modify > Divide
- Click polyline, then click node between straight part and curved part
- Repeat to split polyline at all four sharp corners
- Select the two curved parts at the bottom which contained the start point of the original polyline and reunite them using Draw > Polyline > Polyline from Selection
- Use Modify > Offset to offset the individual parts, etc.

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Fri Sep 13, 2019 9:16 am

And then to discover there are no curved line in the drawing!!
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

lynsg
Newbie Member
Posts: 6
Joined: Fri Sep 13, 2019 7:32 am

Re: Select and offset

Post by lynsg » Fri Sep 13, 2019 9:51 am

Hmm, having tried that, the lines do not split properly. One curved line splits within the line and one corner node repeatedly fails to split - as evidence by the offset lines. Also is it possible to remove the original line while offsetting?

I've just tried importing a number of wavefront .obj files made in Blender, and they all fail to import with errors thrown. Perhaps this installation of Qcad is faulty?

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 3318
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Select and offset

Post by Husky » Fri Sep 13, 2019 9:59 am

lynsg wrote:
Fri Sep 13, 2019 9:51 am
Hmm, having tried that, the lines do not split properly. One curved line splits within the line and one corner node repeatedly fails to split - as evidence by the offset lines.
The reason could be how the other software created that shape. If the knot solution fails try to cut the shape in the sharp corner with the "Divide" tool.

That could look like this result:

Husky-2019.09.13-01.png
Husky-2019.09.13-01.png (23.86 KiB) Viewed 2408 times
Work smart, not hard: QCad Pro

If a thread is considered as "solved" please change the title of the first post to "[solved] Title...". Thanks!

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Fri Sep 13, 2019 10:08 am

This is my result.

Regards,
CVH
Attachments
r7-p1-01_v2.dxf
(134.86 KiB) Downloaded 108 times
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

lynsg
Newbie Member
Posts: 6
Joined: Fri Sep 13, 2019 7:32 am

Re: Select and offset

Post by lynsg » Fri Sep 13, 2019 11:07 am

I have just replaced v 3.22. with v3.23, but am still having no luck. I suppose if the shape is properly split at the 4 nodes I should be able to delete one line after offsetting it. I really don't want to keep on with Blender and its god-awful UI and broken export, so I'll have another go at Qcad tonight.

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Fri Sep 13, 2019 11:18 am

lynsg wrote:
Fri Sep 13, 2019 11:07 am
I suppose if the shape is properly split at the 4 nodes ....
Please enlighten me, us.
Your shape consist of 681 vertexes.
All 681 segments are straight lines.

Where do you want the shape to be cut?

With a cloned Poly Simplify factor 1 we get a good idea of where the co-linears are.
At these points I cut up your shape.
Still 681 vertexes in total.
But split in 'may have been straight' and 'may have been the same curve'

Regards,
CVH
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

lynsg
Newbie Member
Posts: 6
Joined: Fri Sep 13, 2019 7:32 am

Re: Select and offset

Post by lynsg » Fri Sep 13, 2019 11:37 am

CVH wrote:
Fri Sep 13, 2019 11:18 am
lynsg wrote:
Fri Sep 13, 2019 11:07 am
I suppose if the shape is properly split at the 4 nodes ....
Please enlighten me, us.
Your shape consist of 681 vertexes.
All 681 segments are straight lines.
Of course a polyline consists of a collection of straight lines between vertices. But when you zoom out and look at the drawing, it is a surface fitted between two curved frames by Delftship, with straight edges to the surface between the ends of each frame. DelftShip then unfolded this surface to a flat panel and exported it as a dxf, which is the file you see. Hence there are two straight lines and two curved lines. What I need to do now is offset the curved lines by a small amount while deleting the original lines, and offset the straight lines by a different amount while keeping the original lines.

For whatever reason, my installation of Qcad 3.23 on Mint 18.3 is not doing what this thread suggests it should be doing. Right now I need to go and do something else and will come back to this tonight.

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Fri Sep 13, 2019 12:09 pm

We, humans, can see the straight and the curved.
And to be honest, objectively looked at:
I see more then 2 straights.
Knowing where to expect straights and where not is allready based on subjectivity.
Then I should use Husky's solution.
Just divide the schape where you think it should be cut.

Regards,
CVH
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Fri Sep 13, 2019 12:13 pm

lynsg wrote:
Fri Sep 13, 2019 11:37 am
Of course a polyline consists of a collection of straight lines between vertices.
Only straight lines? What about curved segments (bulging).
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 3318
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Select and offset

Post by Husky » Fri Sep 13, 2019 7:40 pm

lynsg wrote:
Fri Sep 13, 2019 11:07 am
I have just replaced v 3.22. with v3.23, but am still having no luck
Make sure not to mix several versions in the same directory! That could lead to unexpected behavior .... :wink:
lynsg wrote:
Fri Sep 13, 2019 11:07 am
I suppose if the shape is properly split at the 4 nodes I should be able to delete one line after offsetting it.
Yes, you are supposing correctly. :wink:
lynsg wrote:
Fri Sep 13, 2019 11:07 am
... so I'll have another go at Qcad tonight.
Take your time and try to understand the workflow of QCAD tools. If that is understood it is very easy to solve a task like this one.
Work smart, not hard: QCad Pro

If a thread is considered as "solved" please change the title of the first post to "[solved] Title...". Thanks!

lynsg
Newbie Member
Posts: 6
Joined: Fri Sep 13, 2019 7:32 am

Re: Select and offset

Post by lynsg » Sun Sep 15, 2019 12:52 pm

I spent some time watching youtube videos (iforce2d in particular is both recent and excellent - and sounds like a fellow Kiwi to boot), and then had another go. I found that joining a broken polyline (started/ended in the middle of a line) had to be done before dividing at the nodes. Some nodes needed to be clicked twice in the same place before they would split, and hovering the mouse showed the status of the line. Offsetting and deleting original lines now works as expected.

As Qcad does other things that will suit my particular use case I have now bought the Pro version, and as "real" CAD is new to me I also bought the book.

Many thanks for the useful and lucid posts from all who replied.

Cheers
Lyn

CVH
Premier Member
Posts: 1040
Joined: Wed Sep 27, 2017 4:17 pm
Location: Belgium; Antwerp

Re: Select and offset

Post by CVH » Sun Sep 15, 2019 7:03 pm

lynsg wrote:
Sun Sep 15, 2019 12:52 pm
I found that joining a broken polyline

I think what you mean by 'broken' is an open polyline. (r7-p1-01.dxf)
In your case a geometrically closed polyline, meaning the endpoint is coincidental with the startpoint.
Polys allways start exactly at a node and end exactly at a node.
Never somewhere else.

We all will use 'node' for what is a 'vertex'.
https://en.wikipedia.org/wiki/Vertex_(geometry)
And 'polyline' or 'poly' for a 'polygonal chain'.
https://en.wikipedia.org/wiki/Polygonal_chain

Simply click near your poly and it will get selected.
The red sqaure is the startpoint, blue are nodes, cyan are segment midpoints.

Your startpoint sits somewhere in a region that may have been an arc from index 676 to index 2.
A fairly recent addition to Qcad is that you can relocate the startpoint of geo closed and logically closed polys.
Draw / Polyline / Relocate startpoint (command OR).

lynsg wrote:
Sun Sep 15, 2019 12:52 pm
(started/ended in the middle of a line)

There is no starting or ending in the 'middle of a line' because it is only you that knows there are only 4 distinct sub-chains.
A line is a straight curve between A and B.
All lines are curves, straight curves may be lines.
Your start and end point is not sitting in the midle of a sub-chain that might have been a straight line.

lynsg wrote:
Sun Sep 15, 2019 12:52 pm
before dividing at the nodes.

I presume by 'at the nodes' you really mean at the 4 distinct apexes.

You can allways simply divide any basic shape at any point on that shape.
In this case at a vertex and even anywhere between vertices.
Modify / Divide (command DI).

Without relocating the startpoint and cutted at the apexes:
The curve between the lower apexes will be two chains.
Clockwise, one from the startpoint to the lower left apex & one from the lower right apex to the endpoint.
Merely selecting both sub-chains and joining them will give you your shape cut in 4.
Draw / Polyline / Polyline from Segments (command OG).

lynsg wrote:
Sun Sep 15, 2019 12:52 pm
Some nodes needed to be clicked twice in the same place before they would split.
A: Its not the first time that I move the mouse a little while clicking.
B: Modify / Divide (command DI) needs two clicks.
firts it ask for an entity to divide.
Then it will ask for a reference to cut the intended entity.
You can see the workflow at the bottom beside the mouse icon.

lynsg wrote:
Sun Sep 15, 2019 12:52 pm
and hovering the mouse showed the status of the line.
Hovering over in selection mode will indicate what entity is the nearest to the mouse pointer.
There is no 'Status' displayed.
I would select the chain so I can follow it as I am panning in complex drawings.


With r7-p1-01.dxf:
In shortnote:
DI
4x select shape + indicate cut
some zooming required
Escape
holding SHIFT + 2x select lower sub-chains
OG
File save & close

done.

This took me 8 seconds...
...with loading your drawing from the forum and booting Qcad.

Regards,
CVH
QCADpro 3.25.2.1 / win7pro 32 bit / 4GB / 1e generation i7 2.6Ghz / HDD GeForce GT 520

Post Reply

Return to “QCAD 'How Do I' Questions”