# How do I cut holes (windows with arched heads out of planes)

Hi

I’ve imported a 2D vrml of a building elevation with arched headed windows. All the geometry is vertices and edges.

Could someone explain how to use the vertices/edges I have in order to cut the window shapes out of the plane to give me three holes with arched heads in a large rectangular plane ready to extrude and insert modelled windows into each hole.

many thanks

I have no idea how your so-called “2D VRML” file is layed out, what with VRML being a 3D format and all, so here’s how I’d model it from scratch:

The easiest way is probably to use a curve - Add a bezier circle and press V, rotate by 45 degrees and scale up, there you get your plane. If you add more curves inside that plane they’ll subtract and become holes (as long as 3D isn’t turned on for the curve). Go into edit buttons and increase the Ext1 slider - this will give the wall a thickness.

Or you can do it with just meshes, but it can get ugly. Add all the outlines as points and edges (select two verts and press F to add an edge) - NO faces. Select all the loops of verts and press Shift+F (backup before doing this). If it triangulates the shape right (it usually does), you should have a mess of triangles that covers the plane with the holes where you wanted. Press Alt+F several times, this will attempt to neaten up the triangles - keep doing this until it stops changing anything. Then press Alt+J, which will try to join triangles together to make quads.

Sorry if that wasn’t what you were after - could you maybe give more detail?

phlip:

What i’m trying to do is import 2D CAD geometry. 2D DXF is not interpreted correctly by Blender so i’m converting to a vrml with accutrans. that gives me really good verts and edges just like a cad drawing. i then go round selecting edges or verts and hitting f to get the faces. this is fine for rectangular shapes but as you say gets really messy with tris when i try to deal with curves, like curved heads to windows. I can understand modelling from scracth over say an image file of my building elevations but as i have cad accurate set out plans available as DXF (read .wrl) i really want to use those. so what would be good would be for the same sort of feature as using bezier or nurbs where it caps the area off after like the old logo demo you see about. Can the verts edges be converted to bezier to do this?

that’s where i’m at.

thanks again

What I’ve done is to import the VRML (or was it DXF?) then cut where I want windows and doors etc. Then select all verts except the doors and extrude them up to the bottom of the window. Then select all except doors and windows then extrude up to the top of the windows and doors. Then select all and extrude to the top of the walls.

%<

Hmm… it might be possible to hack together a python script to convert chains of verts into bezier curves - I don’t know the Curve API well enough and it’s too late at night (read: 4am), but if you’re still stuck tomorrow I’ll give it a shot.

Which would work if the windows and doors were rectangular, but as he’s said, they aren’t.

phlip:

if you could find the time for a script that would be excellent news.

Fligh %:

hi, thanks for the info, that’s the sort of way of done previously and also extruding up of a base plan rather than from elevations but arches, curves etc gets messy.

thanks guys.

Gimble3D sent me this script in chat, written by 3R:

You have to have a mesh which has just one curve in it (use P to separate it) and it can’t be a closed loop (delete one of the edges, use C in edit mode to close the loop after the curve is created)

``````#################################
#  Script pour convertir un 		#
#	    		 mesh en path				  #
#################################
# by 3R - 17/05/05
# pour tout probleme :
#	[email protected]
#	ou sur le newsgroup:
# http://zoo-logique.org/3D.Blender/
#
#You can visit www.cybercreator.fr.st
#####################################
#-------------Utilisation-----------#
#																		#
#Selectionner le mesh a transformer #
#Le mesh doit etre une ligne brisee	#
#Lancer avec Alt+P									#
#####################################

import Blender
from Blender import NMesh,Curve

ObjSel=Blender.Object.GetSelected()
aremesh=0
for obj in ObjSel:
mesh=obj.getData()
if type(mesh)==Blender.Types.NMeshType:
aremesh=1
Mfaces=mesh.faces
Vertexs=[]
ok=0
for face in Mfaces:
if len(face.v)==2:
Vertexs.append(face.v[0].index)
Vertexs.append(face.v[1].index)
ok=1

if ok==1:
bout=[]
for i in range(len(mesh.verts)):
if Vertexs.count(i)==1:
bout.append(i)
if Vertexs.count(i)&gt;2 or Vertexs.count(i)==0:
ok=0
if len(bout)&gt;2:
ok=0
if ok==1:
path=Blender.Object.New('Curve',str(obj.name)+" curve")
curve=Blender.Curve.New(str(obj.name))
pt=mesh.verts[bout[0]].co
curve.setFlag(7)
curve.appendNurb([pt[0],pt[1],pt[2],100])
ind=bout[0]
for k in range(len(mesh.verts)-1):
if Vertexs.index(ind)%2==0:
u=Vertexs.index(ind)
Vertexs.pop(u)
ind=Vertexs.pop(u)
else:
u=Vertexs.index(ind)
Vertexs.pop(u)
ind=Vertexs.pop(u-1)
print Vertexs
pt=mesh.verts[ind].co
curve[0].append([pt[0],pt[1],pt[2],100])
curve.update()
path.setMatrix(obj.getMatrix())

if ok==0:

if aremesh==0:
``````

phlip:

thanks for coming back with a script. I haven’t managed to get it to work with the geometry i’d like to convert. The script tells me that the chosen mesh is not linier.

what would be required to get a script going that a user could select a series of verts and convert to bezier or nurbs curve? I’m assuming that when they are curves (closed) that they could be ‘capped’ or used as a cookie cutter through a plane or cube or whatever?

thanks again.

I just realised - this script is probably too old.
Earlier, edges had no special handling - if you needed an edge without a face it’d just store a face with 2 verts - this is what the script is looking for.
But this changed with things like LSCM and subsurf creases that need an actual “edge” data structure - so edges are being stored there instead of the faces list, so there are no 2-vert faces for the script to find.

should be easily fixable with a bit of tinkering…

Done!

Replace

``````		for face in Mfaces:
if len(face.v)==2:
Vertexs.append(face.v[0].index)
Vertexs.append(face.v[1].index)
ok=1
``````

with

``````		for edge in mesh.edges:
Vertexs.append(edge.v1.index)
Vertexs.append(edge.v2.index)
ok=1
``````

That works for me (in 2.40a2).

yellow, I think you’re trying to get too complicated with this by trying to incorporate curves in your mesh when this may not be necessary. I’ve found you can simulate curves and curved surfaces very well using smoothed subsurfs and edge creases.

Here’s a mesh in edit mode that looks kinda like an arch.

Here’s the same mesh with subsurf turned on (level 2):

By judicious application of edge creases (Shift-E on selected edges) you can get it to look a lot like a curved surface: (click the “Draw Creases” button in mesh tools 1 to see the thicker lines for creased edges.)

Here’s a better view:

For illustration only, here’s the same mesh after converting it with Alt-C: (Don’t recommend doing this, as it will shoot your polycount out the wazoo! Just wanted to illustrate how subsurf works here.)

All the edges running the length of the mesh are creased to 1.0. All those wrapping around it (except on the ends) are level 0.0. The end edges were creased to 1.0 to give square corners at the ends. (Note the thicker lines in the images above.) Tinkering with Shift-E will show you what’s happening.

A much better/easier way than trying to incorporate actual curved entities, maybe?

mzungu:

hi again, thanks for the info. the problem is not producing an arch, with a cad inport it is just verts with edges between and extrude and face. What I’m trying to sort out is the plane the planes around the arches and how messy they can get. ie the wall that the arches sits in that’s what gets messy, did you ever see the 3D Studio Viz demo where you input a 2D flat building elevation and viz detects the islands (ie. window apatures) and produces a wall mesh capped, for you to extrude with the holes ready to recieve your arches and window frames.

thanks again

Could you post a wireframe view of your problem? I think I know what you’re saying, and it might just be a need for judicious use of the ALT-J (join faces into quads) command.

Is this the kind of situation you’re wondering about?

Usually, you just have to subdiv (W-key) the lines (say like along the top) where the arch segments will hit before putting the faces in (F-Key). Another handy tool might be the loop cut knife (K-key) tool. The thing that’s nice about mesh editing in blender, is its flexibility. Once you have the vertices in place, you can create either lines or planes at will to fill things in as you need them to be. It doesn’t have to be a completely enclosed mesh (all faces filled in) all the time.

Its always good to keep quads rather than tris, but really more for subsurf or uv mapped situations. I’m gonna love it when we get true n-gons!

mzungu:

I can see where your coming from with subdivide but the with the cad import all my verts are there for the whole cad drawing and i’d have to duplicate the verts at the same spacings from the arches up and across to the edges of my walls in order to get the neat faces your showing. Also subdivide breaks down in equal multiples but my window positions and spacing on the cad drawings don’t follow the same symetrical rule. so after i’ve subdivided i’d have to manually move the verts of the subdivided to align. Bearing in mind we don’t have dynamic object snapping in Blender I really don’t want to have to chase the cursor about with control s. if you could just drag a vert and snap to another in one move life would be a lot easier. i really don’t understand what appears to be a dislike of object snapping, every avenue i take with modelling something just shouts out for them.

i’d post some images to explain but i don’t have webspace to link to and Blender General doesn’t let me do images by attachment.

I’ve tried the script phlip’s found but i’m getting a syntax error at import blender, so no luck so far. However i roughly traced a window opening with a bezier poly like in the logo tutorial duplicated it for a row of 10 windows, put a curve around the edge of the wall panel where the window openings sit and job done. 10 neat holes in a face.

So that’s why i’m pursuing making use of the verts from the cad drawing converted into poly beziers automated by a script to give me wall panels with neat holes without subdividng down to the nth degree.

However please bear in mind i’m a blender noob and that i don’t know if it’s the right way to do it or that there may be implications further on.

thanks again.

DracoFodder:

thanks for your interest. I mention above problems with images for me.

phlip:

Script at work on WinXP would run without error. Home on Linux failing with syntax error at import blender.

many thanks.

just thought of another problem vrml imports converted from DXF using accutrans appear to create concave faces in blender when you hit f, so they look odd when viewed solid. any ideas?

Yeah, the neatness of my illustration mesh is not very “real world”. I don’t think your mesh has to be neat (ie: rectangular faces) to get an effective render. I’m thinking its more important just that they are quads.

Naw, like I said above, they don’t have to be parallelagrams to render out fine. Just needs to be enough verts along the top edge of the wall to match the number in your arched window section(s).

Hey, I totally agree with you on this one (snaps)! A more effective method of doing this has been needed for as long as I’ve been a user. The 3D cursor has its uses, for sure, but for snapping its very very clumsy.

There’re several free image hosts available. Try www.imageshack.us or Alltaken’s mudpuddle gallery (my personal fav.)

Sounds like you’ve got a fairly quick solution there. It would be nice to be able to use the existing verts somehow, tho. I’d personally go with filling in the faces myself, but whichever works quicker for ya…

I thot you were importing 2D layouts… do you mean that all the entities on that 2D plane are not exactly at zero on the z axis? not quite sure what you mean, here, I guess…

This is what I do in AutoCAD:
First of all, arcs don’t come in to Blender from AutoCAD. I wish they did.
Second, I set up a solid hatch-fill pattern, and flood the elevation. This produces a solid-filled shape in AutoCAD, detecting the hole as an island.
Third, export this shape out as 3ds.
Fourth, import into Blender.

This works. Unfortunately, it will convert the curve into a series of edges (I think based on your AutoCAD’s CIRCLERES variable), but it brings it in as a mesh. You would then need to clean up the triangles.
-Brian

Here is my sample. It contains the AutoCAD file and 3ds export of the file. Note: when you import, because of the coordinate system, you will need to zoom way out (just press the home key right after you import. Because it will be selected when you import, home will zoom to it)
-Brian
http://www.geocities.com/treacy_brian/tmp.zip

And this method produces a 2D 3DS file? Interesting technique. I think yellow’s limitation here is that he’s on LT, and thus no 3DSOUT command. (Have you played with the FACETRES variable to control exported 3DS mesh density, or is this a 3D-only control?)

As far as that goes, I’d prefer to model the whole thing in AutoCAD 3D solids (ACIS), then import that into blender via 3DS. AutoCAD’s primitive boolean capability may be crude, but you can do a lot with it. I just don’t think yellow has that option here.

(Have you played with the FACETRES variable to control exported 3DS mesh density, or is this a 3D-only control?)

I have not tried adjusting that variable. The technique I posted is a “pretty” way of bringing in a curve or arc. Before I stumbled across it, I would simply trace overtop of my arc with a P-Line and make 4 to 8 edges, and then delete the arc underneath leaving my “low-res” curve to be imported in. I do still like this method, and probably use it more often, as it is a very accurate way of controling the amount and placement of the verticies. However, one day I had a Spline that was very long and I didn’t want to take the time to trace it. So I had an idea that maybe as a shape it would come in. Therefore I closed the ends off and flooded it with a hatch pattern: making a closed filled shape. I then extruded it, exported it to 3ds, and imported it to Blender, and success! Later I thought “maybey it doesn’t need to be a solid”, and tried it as a 2d shape, and it worked.

As far as that goes, I’d prefer to model the whole thing in AutoCAD 3D solids (ACIS), then import that into blender via 3DS. AutoCAD’s primitive boolean capability may be crude, but you can do a lot with it.

To some extent, I would agree with you completely. My only major dislike about AutoCAD in 3d is the view rotations, vports, and model space/paperspace I fell are bulky. As for precision, nothing beats it! Except MicroStation V8, which I prefer to AutoCAD. Have a nice day,
-Brian

BrianT:

Thanks for the info. However mzungu’s correct I’m on LT and QCad at home.

However no matter as I’ve got a solution that’s working ok for now. That is 2D DXF out of LT including AutoCAD fonts should I want. Into Accutrans and convert to vrml 1.0 (mzungu: the concave face stuff was because I exported out of accutrans with ‘floating point’ not integar once I changed that vrml are sweet now, including autocad text import (not TTF))

Then I snap a curve to the verts (painful ctrl s over and over) then a curve for the boundary and i get neat holes in a ‘capped’ mesh. I then use verts and edges with F key to do the easy stuff.

What would speed this up would be a script to select a series of verts in order and then convert to a curve.

Thanks again.