Message: SubtractionSolid Inconsistently Subtracting Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question SubtractionSolid Inconsistently Subtracting 

Forum: Geometry
Date: 02 Dec, 2009
From: John Neuhaus <John Neuhaus>

Hey guys,

I'm making a quartz plate with embedded composite fibers. I start by making a G4Box for the quartz plate, then making a G4Tubs with the length and overall diameter of the final fiber. I use the boolean subtraction to cut out a half-circle trough for the fiber to sit in, moving the G4Tubs around to make the grooves where I need them (I'm only doing one for debugging right now).

Here's the problem: The subtraction is not consistently taking place in the same, or even correct spot. I have my sim set with configurable geometry, and when I update the geometry without changing parameters, the groove jumps around by +- 10 micrometers in the Y direction (the direction as my offset across the plate, not through its depth). It also has a rotational deviation that appears to be around the Y axis. I have to rotate the Tubs 90 degrees around the Y so it goes across the plate instead of through, initially.

I've gone back and made sure every translation and rotation is initialized to zero, and the problem persists. The actual plate is perfectly stationary, and when I place the fiber (as an assembly volume), it is in the right place, and equally stationary. The groove, however, jumps around, and is never concentric with the fiber, as it should be.

I also printed the results of getX(), getPhi(), etc. from the transformations moving the groove, but they all report the same numbers every time, despite the obvious differences. What on earth is going on? I appended the relevant section of detector construction, and apologies for verbosity.

Also, the unmentioned variables used in offsets and dimensions are all declared as doubles and initialized earlier, likewise any other missing declarations.

	qp_box = new G4Box("Plate",20.0/2*cm,20.0/2*cm,qzPlateThickness/2.0*cm);  //Box for the plate

	double outer_rad = (fiberDiameter/2.0 + pTPness + 100.0/2.0)*um;  //radius of groove
	G4Tubs * qz_cut = new G4Tubs("Cutout",0,outer_rad,fibLen/2.0*cm,pi/2.0,pi);  //tube representing the groove

	G4RotationMatrix Rq(0,0,0);
	Rq.rotateY(90.0*deg);  //rotate the fiber
	G4ThreeVector Tq(0,0,0);

	Tq.setZ(-qzPlateThickness/2.0*cm);  //Offset the fiber so cuts out a half-circle
	double q_off = 20.00/5.00*cm;

	G4SubtractionSolid * cut_qz;  //resulting solid

	G4Transform3D TrQ;  //transform, used as alternative to Rq and Tq

	for(int j = 0; j >=0; j--)  //For one side of the plate
	{
		double off = (-2.00+j)*q_off;  //vertical offset
		Tq.setY(off);
		TrQ=G4Transform3D(Rq,Tq);  //resultant transform
		//printf("Qz Cutout Translation X:%Lf Y:%Lf Z:%Lf\n",Tq.getX(),Tq.getY(),Tq.getZ());  //old printf
		if(j ==0)  //if this is the first cut,
		{
			cut_qz = new G4SubtractionSolid("Cut Quartz", qp_box, qz_cut, TrQ);  //take it out of the original plate
		}
		else
		{
			cut_qz = new G4SubtractionSolid("Cut Quartz", cut_qz, qz_cut, TrQ);  //otherwise take it out of the cut plate
		}
	}

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: SubtractionSolid Inconsistently Subtracting   (Vladimir Grichine - 02 Dec, 2009)
1 Feedback: Re: SubtractionSolid Inconsistently Subtracting   (John Neuhaus - 02 Dec, 2009)
(_ None: Re: SubtractionSolid Inconsistently Subtracting   (Vladimir Grichine - 02 Dec, 2009)
(_ None: Re: SubtractionSolid Inconsistently Subtracting   (John Neuhaus - 02 Dec, 2009)
(_ None: Re: SubtractionSolid Inconsistently Subtracting   (John Allison - 02 Dec, 2009)
2 None: Re: SubtractionSolid Inconsistently Subtracting   (Joseph Perl - 02 Dec, 2009)
1 Ok: Re: SubtractionSolid Inconsistently Subtracting   (John Neuhaus - 02 Dec, 2009)
 Add Message Add Message
to: "SubtractionSolid Inconsistently Subtracting"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]